File: run-retain.sh

package info (click to toggle)
elfutils 0.194-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,680 kB
  • sloc: ansic: 114,970; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (48 lines) | stat: -rwxr-xr-x 2,219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright (C) 2020 Red Hat, Inc.
# This file is part of elfutils.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# elfutils is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

. $srcdir/test-subr.sh

# - retian.s
#   .section        .data.retain,"R" 
#   .word   1
#
# as -o testfile-retain.o retain.s

testfiles testfile-retain.o

testrun_compare ${abs_top_builddir}/src/readelf -S testfile-retain.o << EOF
There are 9 section headers, starting at offset 0x158:

Section Headers:
[Nr] Name                 Type         Addr             Off      Size     ES Flags Lk Inf Al
[ 0]                      NULL         0000000000000000 00000000 00000000  0        0   0  0
[ 1] .text                PROGBITS     0000000000000000 00000040 00000000  0 AX     0   0  1
[ 2] .data                PROGBITS     0000000000000000 00000040 00000000  0 WA     0   0  1
[ 3] .bss                 NOBITS       0000000000000000 00000040 00000000  0 WA     0   0  1
[ 4] .data.retain         PROGBITS     0000000000000000 00000040 00000002  0 WAR    0   0  1
[ 5] .note.gnu.property   NOTE         0000000000000000 00000048 00000030  0 A      0   0  8
[ 6] .symtab              SYMTAB       0000000000000000 00000078 00000090 24        7   6  8
[ 7] .strtab              STRTAB       0000000000000000 00000108 00000001  0        0   0  1
[ 8] .shstrtab            STRTAB       0000000000000000 00000109 0000004c  0        0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), N (extra OS processing required), G (group), T (TLS),
  C (compressed), O (ordered), R (GNU retain), E (exclude)

EOF

testrun ${abs_top_builddir}/src/elflint --gnu testfile-retain.o