diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-08-07 10:28:42 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-08-07 10:35:58 -0700 |
commit | d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4 (patch) | |
tree | 95f22b0c72cd452bb7b2114d8e6d0a46f34ad42e /binutils/testsuite/binutils-all/strip-12.d | |
parent | f12899e9f081bb857c96999386e64a4252c4a325 (diff) | |
download | gdb-d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4.zip gdb-d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4.tar.gz gdb-d4ac1f878ecef58f1e4b4ff0cbfb4b475656eaf4.tar.bz2 |
Check sh_type/sh_flags/sh_addralign/sh_entsize when copying sh_link/sh_info
When copying the sh_link and sh_info fields in stripped section headers,
we also check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since --only-keep-debug
turns all non-debug sections into SHT_NOBITS sections, the output
SHT_NOBITS type matches any input type.
bfd/
PR binutils/18785
* elf.c (_bfd_elf_copy_private_bfd_data): When copying the
sh_link and sh_info fields in stripped section headers, we also
check if the sh_type, sh_flags, /sh_addralign and sh_entsize
fields of the output section match the output. Since
--only-keep-debug turns all non-debug sections into SHT_NOBITS
sections, the output SHT_NOBITS type matches any input type.
binutils/testsuite/
PR binutils/18785
* binutils-all/objcopy.exp: Run strip-12.
* binutils-all/strip-12.d: New file.
* binutils-all/strip-12.s: Likewise.
Diffstat (limited to 'binutils/testsuite/binutils-all/strip-12.d')
-rw-r--r-- | binutils/testsuite/binutils-all/strip-12.d | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/strip-12.d b/binutils/testsuite/binutils-all/strip-12.d new file mode 100644 index 0000000..a33faab --- /dev/null +++ b/binutils/testsuite/binutils-all/strip-12.d @@ -0,0 +1,7 @@ +#PROG: strip +#strip: +#readelf: -S --wide + +#... + \[[ 0-9]+\] \.bss[ \t]+NOBITS[ \t0-9a-f]+WA[ \t]+0[ \t]+0[ \t]+1 +#pass |