aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfweak
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-12-03 20:59:43 +1030
committerAlan Modra <amodra@gmail.com>2016-12-03 20:59:43 +1030
commit4e95fbcd79b84308417fc25ce12cacdb2a61c0d0 (patch)
tree3a229b0df5742747ab889fb9ed603ba270dd948c /ld/testsuite/ld-elfweak
parentca16c5b392b1c78019fea1710c4f4433161626c5 (diff)
downloadbinutils-4e95fbcd79b84308417fc25ce12cacdb2a61c0d0.zip
binutils-4e95fbcd79b84308417fc25ce12cacdb2a61c0d0.tar.gz
binutils-4e95fbcd79b84308417fc25ce12cacdb2a61c0d0.tar.bz2
PowerPC64 dot-sym testsuite fixes
This illustrates quite well why dot-symbols had to go. PowerPC64 gcc for Linux stopped producing them 12 years ago, but the Linux kernel still persists in using them so it's necessary to keep and regression test ld support. * testsuite/ld-elf/indirect1b.c: Give dot-symbol a version too. * testsuite/ld-elf/indirect2.c: Likewise. * testsuite/ld-elf/indirect3b.c: Likewise. * testsuite/ld-elf/indirect4b.c: Likewise. * testsuite/ld-elf/pr18718.c: Likewise. * testsuite/ld-elf/pr18720b.c: Likewise. * testsuite/ld-elf/pr19553c.c: Likewise. * testsuite/ld-elfvers/vers.h (FUNC_SYMVER): Define. * testsuite/ld-elfvers/vers1.c: Use FUNC_SYMVER for functions. * testsuite/ld-elfvers/vers4.c: Likewise. * testsuite/ld-elfvers/vers5.c: Likewise. * testsuite/ld-elfvers/vers6.c: Likewise. * testsuite/ld-elfvers/vers7a.c: Likewise. * testsuite/ld-elfvers/vers9.c: Likewise. * testsuite/ld-elfvers/vers15.c: Likewise. * testsuite/ld-elfvers/vers18.c: Likewise. * testsuite/ld-elfvers/vers22a.c: Likewise. * testsuite/ld-elfvers/vers23a.c: Likewise. * testsuite/ld-elfvers/vers27d1.c: Likewise. * testsuite/ld-elfvers/vers21.c: Likewise. (_old_bar): Use attribute weak rather than asm weak. * testsuite/ld-ifunc/pr16467b.c: Give dot-symbol a version. * testsuite/ld-plugin/pr12760b.c: Define warning on .bar rather than bar for ppc64 -mcall-aixdesc. * testsuite/ld-plugin/pr16746a.c: Similarly for foobar. * testsuite/ld-plugin/pr16746b.c: Likewise. * testsuite/ld-elf/shared.exp: Allow dot-symbol in warnings and errors. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-plugin/plugin-6.d: Likewise. * testsuite/ld-plugin/plugin-7.d: Likewise. * testsuite/ld-plugin/plugin-8.d: Likewise. * testsuite/ld-plugin/plugin-13.d: Likewise. * testsuite/ld-plugin/plugin-14.d: Likewise. * testsuite/ld-plugin/plugin-15.d: Likewise. * testsuite/ld-plugin/plugin-16.d: Likewise. * testsuite/ld-plugin/plugin-20.d: Likewise. * testsuite/ld-plugin/plugin-21.d: Likewise. * testsuite/ld-plugin/plugin-22.d: Likewise. * testsuite/ld-plugin/plugin-23.d: Likewise. * testsuite/ld-plugin/plugin.exp: Define .main and .puts for ppc64 -mcall-aixdesc. * testsuite/ld-elfvers/vers.exp (test_ar): Trim dot-symbols. (objdump_dynsymstuff): Likewise. (objdump_symstuff): Likewise. Pack flags to keep column count consistent. * testsuite/ld-elfweak/elfweak.exp (objdump_dynsymstuff, objdump_symstuff): As for vers.exp. * testsuite/ld-elfvers/vers6.sym: Allow dot-symbols. * testsuite/ld-elfvers/vers1.sym: Allow missing F flag for -mcall-aixdesc .opd syms and adjust for flag packing. * testsuite/ld-elfvers/vers4.sym: Likewise. * testsuite/ld-elfvers/vers4a.sym: Likewise. * testsuite/ld-elfvers/vers7a.sym: Likewise. * testsuite/ld-elfvers/vers9.sym: Likewise. * testsuite/ld-elfvers/vers15.sym: Likewise. * testsuite/ld-elfvers/vers18.sym: Likewise. * testsuite/ld-elfvers/vers21.sym: Likewise. * testsuite/ld-elfvers/vers22a.sym: Likewise. * testsuite/ld-elfvers/vers23a.sym: Likewise. * testsuite/ld-elfvers/vers27d.sym: Likewise. * testsuite/ld-elfweak/strong.sym: Likewise. * testsuite/ld-elfweak/strongcomm.sym: Likewise. * testsuite/ld-elfweak/strongdata.sym: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elfweak')
-rw-r--r--ld/testsuite/ld-elfweak/elfweak.exp18
-rw-r--r--ld/testsuite/ld-elfweak/strong.sym2
-rw-r--r--ld/testsuite/ld-elfweak/strongcomm.sym4
-rw-r--r--ld/testsuite/ld-elfweak/strongdata.sym4
4 files changed, 15 insertions, 13 deletions
diff --git a/ld/testsuite/ld-elfweak/elfweak.exp b/ld/testsuite/ld-elfweak/elfweak.exp
index 31801eb..d3037e1 100644
--- a/ld/testsuite/ld-elfweak/elfweak.exp
+++ b/ld/testsuite/ld-elfweak/elfweak.exp
@@ -82,9 +82,9 @@ proc objdump_symstuff { objdump object expectfile } {
if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" }
- verbose -log "$objdump $SOBJDUMP_FLAGS $object | grep foo$ > $tmpdir/objdump.out"
-
- catch "exec $objdump $SOBJDUMP_FLAGS $object | grep foo$ > $tmpdir/objdump.out" exec_output
+ set cmd "$objdump $SOBJDUMP_FLAGS $object | sed -n {s/^\\(\[0-9a-f\]* *\\)\\(\[gw\]\\)\\( *\\)\\(\[FO\]\\)/\\1\\2\\4\\3/;/foo$/p} > $tmpdir/objdump.out"
+ verbose -log $cmd
+ catch "exec $cmd" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
@@ -123,7 +123,8 @@ proc objdump_symstuff { objdump object expectfile } {
close $file_a
while { [gets $file_b line] != $eof } {
- if [regexp "^#.*$" $line] then {
+ if [regexp {\.text.* \.[^ ]*$} $line] then {
+ # Discard defined powerpc64 dot-symbols
continue
} else {
lappend list_b $line
@@ -177,9 +178,9 @@ proc objdump_dynsymstuff { objdump object expectfile } {
if ![info exists DOBJDUMP_FLAGS] { set DOBJDUMP_FLAGS "" }
- verbose -log "$objdump $DOBJDUMP_FLAGS $object | grep foo$ > $tmpdir/objdump.out"
-
- catch "exec $objdump $DOBJDUMP_FLAGS $object | grep foo$ > $tmpdir/objdump.out" exec_output
+ set cmd "$objdump $DOBJDUMP_FLAGS $object | grep foo$ > $tmpdir/objdump.out"
+ verbose -log $cmd
+ catch "exec $cmd" exec_output
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] then {
@@ -218,7 +219,8 @@ proc objdump_dynsymstuff { objdump object expectfile } {
close $file_a
while { [gets $file_b line] != $eof } {
- if [regexp "^#.*$" $line] then {
+ if [regexp {\.text.* \.[^ ]*$} $line] then {
+ # Discard defined powerpc64 dot-symbols
continue
} else {
lappend list_b $line
diff --git a/ld/testsuite/ld-elfweak/strong.sym b/ld/testsuite/ld-elfweak/strong.sym
index 531d358..27d0daa 100644
--- a/ld/testsuite/ld-elfweak/strong.sym
+++ b/ld/testsuite/ld-elfweak/strong.sym
@@ -1 +1 @@
-[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+[ ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ +(0x[0-9a-f]+ )?foo
diff --git a/ld/testsuite/ld-elfweak/strongcomm.sym b/ld/testsuite/ld-elfweak/strongcomm.sym
index 2a8c6cd..c5fe85c 100644
--- a/ld/testsuite/ld-elfweak/strongcomm.sym
+++ b/ld/testsuite/ld-elfweak/strongcomm.sym
@@ -1,2 +1,2 @@
-[0-9a-f]+[ ]+g[ ]+O[ ]+\.s?bss[ ]+[0-9a-f]+[ ]+deallocate_foo
-[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+[ ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+ gO +\.s?bss [0-9a-f]+ +deallocate_foo
+[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ +(0x[0-9a-f]+ )?foo
diff --git a/ld/testsuite/ld-elfweak/strongdata.sym b/ld/testsuite/ld-elfweak/strongdata.sym
index 88aa1c9..d09722a 100644
--- a/ld/testsuite/ld-elfweak/strongdata.sym
+++ b/ld/testsuite/ld-elfweak/strongdata.sym
@@ -1,2 +1,2 @@
-[0-9a-f]+[ ]+g[ ]+O[ ]+\.s?(data|bss)[ ]+[0-9a-f]+[ ]+deallocate_foo
-[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+[ ]+(0x[0-9a-f]+ )?foo
+[0-9a-f]+ gO +\.s?(data|bss) [0-9a-f]+ +deallocate_foo
+[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ +(0x[0-9a-f]+ )?foo