aboutsummaryrefslogtreecommitdiff
path: root/binutils/testsuite/lib/binutils-common.exp
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-06-23 22:11:57 +0930
committerAlan Modra <amodra@gmail.com>2016-06-24 23:26:29 +0930
commit9cc0123fea25379a1d57b700c078c7a9d0992f61 (patch)
treec6c60a576c0e646e2261abc15d3c84af7d458530 /binutils/testsuite/lib/binutils-common.exp
parent78da3bc1eeb8ed227f86154ef915635fe9047a64 (diff)
downloadgdb-9cc0123fea25379a1d57b700c078c7a9d0992f61.zip
gdb-9cc0123fea25379a1d57b700c078c7a9d0992f61.tar.gz
gdb-9cc0123fea25379a1d57b700c078c7a9d0992f61.tar.bz2
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.
Diffstat (limited to 'binutils/testsuite/lib/binutils-common.exp')
-rw-r--r--binutils/testsuite/lib/binutils-common.exp30
1 files changed, 30 insertions, 0 deletions
diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp
index 33a0382..bfe2998 100644
--- a/binutils/testsuite/lib/binutils-common.exp
+++ b/binutils/testsuite/lib/binutils-common.exp
@@ -202,6 +202,36 @@ proc supports_gnu_unique {} {
return 1
}
+# True for targets that do not sort .symtab as per the ELF standard.
+# ie. any that have mips_elf32_be_vec, mips_elf32_le_vec,
+# mips_elf32_n_be_vec or mips_elf32_n_le_vec as the primary bfd target
+# vector in config.bfd. When syncing with config.bfd, don't forget that
+# earlier case-matches trump later ones.
+proc is_bad_symtab {} {
+ if { ![istarget "mips*-*-*"] } {
+ return 0;
+ }
+ if { [istarget "*-*-chorus*"]
+ || [istarget "*-*-irix5*"]
+ || [istarget "*-*-irix6*"]
+ || [istarget "*-*-none"]
+ || [istarget "*-*-rtems*"]
+ || [istarget "*-*-windiss"] } {
+ return 1;
+ }
+ if { [istarget "*-*-elf*"]
+ && ![istarget "*-sde-*"]
+ && ![istarget "*-mti-*"]
+ && ![istarget "*-img-*"] } {
+ return 1;
+ }
+ if { [istarget "*-*-openbsd*"]
+ && ![istarget "mips64*-*-*"] } {
+ return 1;
+ }
+ return 0;
+}
+
# Compare two files line-by-line. FILE_1 is the actual output and FILE_2
# is the expected output. Ignore blank lines in either file.
#