diff options
author | Nick Clifton <nickc@redhat.com> | 2017-12-08 10:07:14 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-12-08 10:07:14 +0000 |
commit | 2d054e6bfdfb0f58fb9cc501c29327df34fec697 (patch) | |
tree | 9ac200639d7ff30b0da20b6ad2d431a5bbb35b1e /binutils/testsuite | |
parent | c8bed57010e8789212a6841db4b397b175a00f9e (diff) | |
download | gdb-2d054e6bfdfb0f58fb9cc501c29327df34fec697.zip gdb-2d054e6bfdfb0f58fb9cc501c29327df34fec697.tar.gz gdb-2d054e6bfdfb0f58fb9cc501c29327df34fec697.tar.bz2 |
Fix stripping relocs in a file with mergeable notes.
A recent Fedora bug (1520805) exposed a problem with objcopy's reloc
copying code, when a binary also contains mergeable notes. The note
merging code would delete some relocs, but then the reloc copying code
would try to put them back again, which did not work.
So I am checking in the patch below to fix the problem. The patch
also tweaks one of the binutils note merging tests so that it is
skipped for the Sparc64 target, since this has funky relocs.
binutils * objcopy.c (copy_relocations_in_section): Use the orelocations
field of the input section, if it has been initialised.
* testsuite/binutils-all/note-2-64.d: Skip test on Sparc64.
bfd * elfcode.h (elf_write_relocs): Check for an empty howto field.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/binutils-all/note-2-64.d | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/note-2-64.d b/binutils/testsuite/binutils-all/note-2-64.d index 8535821..f9be897 100644 --- a/binutils/testsuite/binutils-all/note-2-64.d +++ b/binutils/testsuite/binutils-all/note-2-64.d @@ -3,6 +3,10 @@ #objcopy: --merge-notes #name: merge notes section (64-bits) #source: note-2-64.s +#not-target: sparc64-*-* +# Internally the Sparc64 backend uses two relocs for every one reloc visible externally. +# Unfortunately the BFD library does not provide a target specific way to delete individual +# relocs, so the note merging feature fails. #... Owner Data size Description |