Don't generate empty reloc sections
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 13 Apr 2012 02:52:34 +0000 (02:52 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 13 Apr 2012 02:52:34 +0000 (02:52 +0000)
commitc398915025cc1d08213bb8fb38e53908b8057904
tree75e6f85b592f02197f2818a73922b5f280613a23
parente319fa28f9559b7164a0a52e34ebcda1a07341c9
Don't generate empty reloc sections

binutils/

PR binutils/13947
* objcopy.c (copy_object): Call copy_relocations_in_section
before copy_section.
(skip_section): New.
(copy_relocations_in_section): Likewise.
(copy_section): Use skip_section.  Don't copy relocations here.

binutils/testsuite/

PR binutils/13947
* binutils-all/i386/compressed-1b.d: Remove empty REL section.
* binutils-all/i386/compressed-1c.d: Likewise.

* binutils-all/x86-64/compressed-1b.d: Remove empty RELA
section.
* binutils-all/x86-64/compressed-1c.d: Likewise.
binutils/ChangeLog
binutils/objcopy.c
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/i386/compressed-1b.d
binutils/testsuite/binutils-all/i386/compressed-1c.d
binutils/testsuite/binutils-all/x86-64/compressed-1b.d
binutils/testsuite/binutils-all/x86-64/compressed-1c.d