1da0c48c4Sopenharmony_ci# Copyright (C) 2020 Red Hat, Inc.
2da0c48c4Sopenharmony_ci# This file is part of elfutils.
3da0c48c4Sopenharmony_ci#
4da0c48c4Sopenharmony_ci# This file is free software; you can redistribute it and/or modify
5da0c48c4Sopenharmony_ci# it under the terms of the GNU General Public License as published by
6da0c48c4Sopenharmony_ci# the Free Software Foundation; either version 3 of the License, or
7da0c48c4Sopenharmony_ci# (at your option) any later version.
8da0c48c4Sopenharmony_ci#
9da0c48c4Sopenharmony_ci# elfutils is distributed in the hope that it will be useful, but
10da0c48c4Sopenharmony_ci# WITHOUT ANY WARRANTY; without even the implied warranty of
11da0c48c4Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12da0c48c4Sopenharmony_ci# GNU General Public License for more details.
13da0c48c4Sopenharmony_ci#
14da0c48c4Sopenharmony_ci# You should have received a copy of the GNU General Public License
15da0c48c4Sopenharmony_ci# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16da0c48c4Sopenharmony_ci
17da0c48c4Sopenharmony_ci. $srcdir/test-subr.sh
18da0c48c4Sopenharmony_ci
19da0c48c4Sopenharmony_ci# - retian.s
20da0c48c4Sopenharmony_ci#   .section        .data.retain,"R" 
21da0c48c4Sopenharmony_ci#   .word   1
22da0c48c4Sopenharmony_ci#
23da0c48c4Sopenharmony_ci# as -o testfile-retain.o retain.s
24da0c48c4Sopenharmony_ci
25da0c48c4Sopenharmony_citestfiles testfile-retain.o
26da0c48c4Sopenharmony_ci
27da0c48c4Sopenharmony_citestrun_compare ${abs_top_builddir}/src/readelf -S testfile-retain.o << EOF
28da0c48c4Sopenharmony_ciThere are 9 section headers, starting at offset 0x158:
29da0c48c4Sopenharmony_ci
30da0c48c4Sopenharmony_ciSection Headers:
31da0c48c4Sopenharmony_ci[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
32da0c48c4Sopenharmony_ci[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
33da0c48c4Sopenharmony_ci[ 1] .text                PROGBITS     0000000000000000 00000040 00000000  0 AX     0   0  1
34da0c48c4Sopenharmony_ci[ 2] .data                PROGBITS     0000000000000000 00000040 00000000  0 WA     0   0  1
35da0c48c4Sopenharmony_ci[ 3] .bss                 NOBITS       0000000000000000 00000040 00000000  0 WA     0   0  1
36da0c48c4Sopenharmony_ci[ 4] .data.retain         PROGBITS     0000000000000000 00000040 00000002  0 WAR    0   0  1
37da0c48c4Sopenharmony_ci[ 5] .note.gnu.property   NOTE         0000000000000000 00000048 00000030  0 A      0   0  8
38da0c48c4Sopenharmony_ci[ 6] .symtab              SYMTAB       0000000000000000 00000078 00000090 24        7   6  8
39da0c48c4Sopenharmony_ci[ 7] .strtab              STRTAB       0000000000000000 00000108 00000001  0        0   0  1
40da0c48c4Sopenharmony_ci[ 8] .shstrtab            STRTAB       0000000000000000 00000109 0000004c  0        0   0  1
41da0c48c4Sopenharmony_ci
42da0c48c4Sopenharmony_ciEOF
43da0c48c4Sopenharmony_ci
44da0c48c4Sopenharmony_citestrun ${abs_top_builddir}/src/elflint --gnu testfile-retain.o
45