]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
MIPS objcopy --rename-section fix
authorAlan Modra <amodra@gmail.com>
Thu, 23 Jun 2016 12:41:57 +0000 (22:11 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 24 Jun 2016 13:56:29 +0000 (23:26 +0930)
commit9cc0123fea25379a1d57b700c078c7a9d0992f61
treec6c60a576c0e646e2261abc15d3c84af7d458530
parent78da3bc1eeb8ed227f86154ef915635fe9047a64
MIPS objcopy --rename-section fix

Some MIPS targets use a named section symbol rather than a symbol with
no name as is used with most ELF targets.  When renaming sections, the
named section symbol needs to be renamed too.

Rather than fix this bug, I'd originally intended to just correct the
xfail added recently for update-1.o vs update4.o in update-section.exp,
using the same set of targets for the localize-hidden-1 mips xfail.
I'd extracted that target test into a new function, is_bad_symtab.  It
turns out to be useful in readelf.exp too.

bfd/
* config.bfd: Delete mips vxworks patterns matched earlier.
Combine mips*-*-none with mips*-*-elf*.
binutils/
* objcopy.c (find_section_rename): Forward declare.  Remove
ibfd and sec_ptr param.  Add old_name param.  Allow for NULL
returned_flags.  Move read of section name and flags to..
(setup_section): ..here.  Update find_section_rename call.
(filter_symbols): Rename section symbols for renamed sections.
(copy_object): Call filter_symbols when renamed sections.
* testsuite/lib/binutils-common.exp (is_bad_symtab): New.
* testsuite/binutils-all/update-section.exp: Revert 96037eb0
mips xfail.
* testsuite/binutils-all/objcopy.exp (copy_executable): Use
is_bad_symtab.
(localize-hidden-1): xfail if is_bad_symtab.
* testsuite/binutils-all/readelf.exp: Use is_bad_symtab to select
between mips/tmips.
bfd/ChangeLog
bfd/config.bfd
binutils/ChangeLog
binutils/objcopy.c
binutils/testsuite/binutils-all/objcopy.exp
binutils/testsuite/binutils-all/readelf.exp
binutils/testsuite/binutils-all/update-section.exp
binutils/testsuite/lib/binutils-common.exp