diff options
author | Alan Modra <amodra@gmail.com> | 2016-12-03 20:59:43 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-12-03 20:59:43 +1030 |
commit | 4e95fbcd79b84308417fc25ce12cacdb2a61c0d0 (patch) | |
tree | 3a229b0df5742747ab889fb9ed603ba270dd948c /ld/testsuite | |
parent | ca16c5b392b1c78019fea1710c4f4433161626c5 (diff) | |
download | gdb-4e95fbcd79b84308417fc25ce12cacdb2a61c0d0.zip gdb-4e95fbcd79b84308417fc25ce12cacdb2a61c0d0.tar.gz gdb-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')
55 files changed, 175 insertions, 118 deletions
diff --git a/ld/testsuite/ld-elf/indirect1b.c b/ld/testsuite/ld-elf/indirect1b.c index 51740f9..60f34527 100644 --- a/ld/testsuite/ld-elf/indirect1b.c +++ b/ld/testsuite/ld-elf/indirect1b.c @@ -4,3 +4,6 @@ foo (void) } asm (".symver foo,foo@FOO"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo,.foo@FOO"); +#endif diff --git a/ld/testsuite/ld-elf/indirect2.c b/ld/testsuite/ld-elf/indirect2.c index 6df29be..e36532d 100644 --- a/ld/testsuite/ld-elf/indirect2.c +++ b/ld/testsuite/ld-elf/indirect2.c @@ -1,6 +1,9 @@ extern void foo (void); asm (".symver foo,foo@@@FOO"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo,.foo@@@FOO"); +#endif void bar (void) diff --git a/ld/testsuite/ld-elf/indirect3b.c b/ld/testsuite/ld-elf/indirect3b.c index dbb37c3..74cc461 100644 --- a/ld/testsuite/ld-elf/indirect3b.c +++ b/ld/testsuite/ld-elf/indirect3b.c @@ -7,3 +7,6 @@ foo (void) } asm (".symver foo,foo@FOO"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo,.foo@FOO"); +#endif diff --git a/ld/testsuite/ld-elf/indirect4b.c b/ld/testsuite/ld-elf/indirect4b.c index b8db9d0..06739b5 100644 --- a/ld/testsuite/ld-elf/indirect4b.c +++ b/ld/testsuite/ld-elf/indirect4b.c @@ -7,6 +7,9 @@ foo2 (void) } asm (".symver foo2,foo@@FOO2"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo2,.foo@@FOO2"); +#endif void foo1 (void) @@ -15,3 +18,6 @@ foo1 (void) } asm (".symver foo1,foo@FOO1"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo1,.foo@FOO1"); +#endif diff --git a/ld/testsuite/ld-elf/pr18718.c b/ld/testsuite/ld-elf/pr18718.c index 5ec1b9e..9cf15e8 100644 --- a/ld/testsuite/ld-elf/pr18718.c +++ b/ld/testsuite/ld-elf/pr18718.c @@ -10,6 +10,9 @@ new_foo (void) } __asm__(".symver new_foo, foo@@VERS_2.0"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +__asm__(".symver .new_foo, .foo@@VERS_2.0"); +#endif #if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__) >= 4005 __attribute__ ((noinline, noclone)) diff --git a/ld/testsuite/ld-elf/pr18720b.c b/ld/testsuite/ld-elf/pr18720b.c index 90d376b..6a2975d 100644 --- a/ld/testsuite/ld-elf/pr18720b.c +++ b/ld/testsuite/ld-elf/pr18720b.c @@ -9,3 +9,8 @@ foo (void) asm (".symver foo,foo@FOO"); asm (".set foo_alias,foo"); asm (".global foo_alias"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo,.foo@FOO"); +asm (".set .foo_alias,.foo"); +asm (".global .foo_alias"); +#endif diff --git a/ld/testsuite/ld-elf/pr19553c.c b/ld/testsuite/ld-elf/pr19553c.c index d80dfc9..7587b4a 100644 --- a/ld/testsuite/ld-elf/pr19553c.c +++ b/ld/testsuite/ld-elf/pr19553c.c @@ -7,3 +7,6 @@ foo (void) } asm (".symver foo,foo@FOO"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +asm (".symver .foo,.foo@FOO"); +#endif diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index f3b6f18..f1d741f 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -454,14 +454,14 @@ if { [ regexp "tmpdir/libneeded1b.so: .*: DSO missing" $exec_output ] } { } set testname "--no-add-needed -shared" set exec_output [run_host_cmd "$CC" "-shared tmpdir/libneeded1pic.o -Wl,--no-add-needed,-z,defs -Ltmpdir -lneeded1a"] -if { [ regexp "undefined reference to `bar'" $exec_output ] } { +if { [ regexp "undefined reference to `\.?bar'" $exec_output ] } { pass $testname } { fail $testname } set testname "--no-copy-dt-needed-entries -shared" set exec_output [run_host_cmd "$CC" "-shared tmpdir/libneeded1pic.o -Wl,--no-copy-dt-needed-entries,-z,defs -Ltmpdir -lneeded1a"] -if { [ regexp "undefined reference to `bar'" $exec_output ] } { +if { [ regexp "undefined reference to `\.?bar'" $exec_output ] } { pass $testname } { fail $testname diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp index a2a678b..4c42342 100644 --- a/ld/testsuite/ld-elfvers/vers.exp +++ b/ld/testsuite/ld-elfvers/vers.exp @@ -122,9 +122,9 @@ proc test_ar { test lib object expect } { return } - verbose -log "$nm --print-armap $tmpdir/$lib | grep \" in \" | egrep \"VERS\\|bar\\|foo\" | sort > $tmpdir/nm.out" - - catch "exec $nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | sort > $tmpdir/nm.out" exec_output + set cmd "$nm --print-armap $tmpdir/$lib | grep \\\ in\\\ | egrep VERS\\\|bar\\\|foo | grep -v ^\\\\. | sort > $tmpdir/nm.out" + verbose -log $cmd + catch "exec $cmd" exec_output if [string match "" $exec_output] then { catch "exec sort $srcdir/$subdir/$expect | $diff $tmpdir/nm.out -" exec_output set exec_output [prune_warnings $exec_output] @@ -245,9 +245,9 @@ proc objdump_symstuff { objdump object expectfile } { if ![info exists SOBJDUMP_FLAGS] { set SOBJDUMP_FLAGS "" } - verbose -log "$objdump $SOBJDUMP_FLAGS $object | grep \@ | sort -k 6 > $tmpdir/objdump.out" - - catch "exec $objdump $SOBJDUMP_FLAGS $object | grep \@ | sort -k 6 > $tmpdir/objdump.out" exec_output + set cmd "$objdump $SOBJDUMP_FLAGS $object | sed -n {s/^\\(\[0-9a-f\]* *\\)\\(\[gw\]\\)\\( *\\)\\(\[FO\]\\)/\\1\\2\\4\\3/;/\@/p} | sort -k 5 > $tmpdir/objdump.out" + verbose -log $cmd + catch "exec $cmd" exec_output set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { @@ -286,7 +286,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 @@ -340,9 +341,9 @@ proc objdump_dynsymstuff { objdump object expectfile } { if ![info exists DOBJDUMP_FLAGS] { set DOBJDUMP_FLAGS "" } - verbose -log "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out" - - catch "exec $objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out" exec_output + set cmd "$objdump $DOBJDUMP_FLAGS $object | sed -n /VERS/p\\\;/show/p | sort | uniq > $tmpdir/objdump.out" + verbose -log $cmd + catch "exec $cmd" exec_output set exec_output [prune_warnings $exec_output] if [string match "" $exec_output] then { @@ -381,7 +382,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-elfvers/vers.h b/ld/testsuite/ld-elfvers/vers.h index 4455527..00385f0 100644 --- a/ld/testsuite/ld-elfvers/vers.h +++ b/ld/testsuite/ld-elfvers/vers.h @@ -7,3 +7,10 @@ /* Generate a .symver reference with symbol prefixes. Usage: SYMVER(foo, foobar@ver); */ #define SYMVER(name, name2) __asm__(".symver " SYMPFX(name) "," SYMPFX(name2)) + +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +#define FUNC_SYMVER(name, name2) SYMVER(name, name2); \ + __asm__(".symver ." SYMPFX(name) ",." SYMPFX(name2)) +#else +#define FUNC_SYMVER(name, name2) SYMVER(name, name2) +#endif diff --git a/ld/testsuite/ld-elfvers/vers1.c b/ld/testsuite/ld-elfvers/vers1.c index 86e2bd2..9813fd3 100644 --- a/ld/testsuite/ld-elfvers/vers1.c +++ b/ld/testsuite/ld-elfvers/vers1.c @@ -49,10 +49,10 @@ hide_new_foo() } -SYMVER(hide_original_foo, show_foo@); -SYMVER(hide_old_foo, show_foo@VERS_1.1); -SYMVER(hide_old_foo1, show_foo@VERS_1.2); -SYMVER(hide_new_foo, show_foo@@VERS_2.0); +FUNC_SYMVER(hide_original_foo, show_foo@); +FUNC_SYMVER(hide_old_foo, show_foo@VERS_1.1); +FUNC_SYMVER(hide_old_foo1, show_foo@VERS_1.2); +FUNC_SYMVER(hide_new_foo, show_foo@@VERS_2.0); @@ -65,7 +65,7 @@ hide_new_bogus_foo() return 1000+bar(); } -SYMVER(hide_new_bogus_foo, show_foo@VERS_2.2); +FUNC_SYMVER(hide_new_bogus_foo, show_foo@VERS_2.2); #endif @@ -83,8 +83,8 @@ xyzzz() bar33(); } -SYMVER(new2_foo, fooVERS_2.0); -SYMVER(bar33, bar@@VERS_2.0); +FUNC_SYMVER(new2_foo, fooVERS_2.0); +FUNC_SYMVER(bar33, bar@@VERS_2.0); #endif #ifdef DO_TEST12 @@ -99,5 +99,5 @@ xyzzz() bar33(); } -SYMVER(bar33, bar@@VERS_2.0); +FUNC_SYMVER(bar33, bar@@VERS_2.0); #endif diff --git a/ld/testsuite/ld-elfvers/vers1.sym b/ld/testsuite/ld-elfvers/vers1.sym index 0196109..206863f 100644 --- a/ld/testsuite/ld-elfvers/vers1.sym +++ b/ld/testsuite/ld-elfvers/vers1.sym @@ -1,4 +1,4 @@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2 diff --git a/ld/testsuite/ld-elfvers/vers15.c b/ld/testsuite/ld-elfvers/vers15.c index 2457d29..a7c044a 100644 --- a/ld/testsuite/ld-elfvers/vers15.c +++ b/ld/testsuite/ld-elfvers/vers15.c @@ -32,6 +32,6 @@ main() return 0; } -SYMVER(foo_1, show_foo@); -SYMVER(foo_2, show_foo@VERS_1.1); -SYMVER(foo_3, show_foo@@VERS_1.2); +FUNC_SYMVER(foo_1, show_foo@); +FUNC_SYMVER(foo_2, show_foo@VERS_1.1); +FUNC_SYMVER(foo_3, show_foo@@VERS_1.2); diff --git a/ld/testsuite/ld-elfvers/vers15.sym b/ld/testsuite/ld-elfvers/vers15.sym index fe56a24..ccf4f4d 100644 --- a/ld/testsuite/ld-elfvers/vers15.sym +++ b/ld/testsuite/ld-elfvers/vers15.sym @@ -1,3 +1,3 @@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_1\.2 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_1\.2 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 diff --git a/ld/testsuite/ld-elfvers/vers18.c b/ld/testsuite/ld-elfvers/vers18.c index 9965b88..fe1017b 100644 --- a/ld/testsuite/ld-elfvers/vers18.c +++ b/ld/testsuite/ld-elfvers/vers18.c @@ -38,7 +38,7 @@ hide_new_foo () return 1000 + bar (); } -SYMVER(hide_original_foo, show_foo@); -SYMVER(hide_old_foo, show_foo@VERS_1.1); -SYMVER(hide_old_foo1, show_foo@VERS_1.2); -SYMVER(hide_new_foo, show_foo@@VERS_2.0); +FUNC_SYMVER(hide_original_foo, show_foo@); +FUNC_SYMVER(hide_old_foo, show_foo@VERS_1.1); +FUNC_SYMVER(hide_old_foo1, show_foo@VERS_1.2); +FUNC_SYMVER(hide_new_foo, show_foo@@VERS_2.0); diff --git a/ld/testsuite/ld-elfvers/vers18.sym b/ld/testsuite/ld-elfvers/vers18.sym index 62890d7..04fa49c 100644 --- a/ld/testsuite/ld-elfvers/vers18.sym +++ b/ld/testsuite/ld-elfvers/vers18.sym @@ -1,4 +1,4 @@ -[0-9a-f]+ +w +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ -[0-9a-f]+ +w +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0 -[0-9a-f]+ +w +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 -[0-9a-f]+ +w +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2 +[0-9a-f]+ +w(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@ +[0-9a-f]+ +w(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@@VERS_2\.0 +[0-9a-f]+ +w(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.1 +[0-9a-f]+ +w(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_foo@VERS_1\.2 diff --git a/ld/testsuite/ld-elfvers/vers21.c b/ld/testsuite/ld-elfvers/vers21.c index 3a75b48..4a994a1 100644 --- a/ld/testsuite/ld-elfvers/vers21.c +++ b/ld/testsuite/ld-elfvers/vers21.c @@ -1,9 +1,8 @@ #include "vers.h" -SYMVER(_old_foo, foo@VERS.0); -SYMVER(_old_bar, bar@VERS.0); +FUNC_SYMVER(_old_foo, foo@VERS.0); +FUNC_SYMVER(_old_bar, bar@VERS.0); SYMVER(_old_foobar, foobar@VERS.0); -__asm__(".weak " SYMPFX(_old_bar)); int bar () @@ -11,7 +10,7 @@ bar () return 1; } -int +int __attribute__ ((weak)) _old_bar () { return bar (); diff --git a/ld/testsuite/ld-elfvers/vers21.sym b/ld/testsuite/ld-elfvers/vers21.sym index 271ca79..f5ade0b 100644 --- a/ld/testsuite/ld-elfvers/vers21.sym +++ b/ld/testsuite/ld-elfvers/vers21.sym @@ -1,3 +1,3 @@ -[0-9a-f]+[ ]+w[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS\.0 -[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0 -[0-9a-f]+[ ]+g[ ]+O[ ]+\.s?data[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foobar@VERS\.0 +[0-9a-f]+ +w(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS\.0 +[0-9a-f]+ +g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0 +[0-9a-f]+ +gO +\.s?data [0-9a-f]+ (0x[0-9a-f]+ )?_?foobar@VERS\.0 diff --git a/ld/testsuite/ld-elfvers/vers22a.c b/ld/testsuite/ld-elfvers/vers22a.c index bc5777b..9a5fcac 100644 --- a/ld/testsuite/ld-elfvers/vers22a.c +++ b/ld/testsuite/ld-elfvers/vers22a.c @@ -1,6 +1,6 @@ #include "vers.h" -SYMVER(_old_bar, bar@VERS.0); +FUNC_SYMVER(_old_bar, bar@VERS.0); void _old_bar () diff --git a/ld/testsuite/ld-elfvers/vers22a.sym b/ld/testsuite/ld-elfvers/vers22a.sym index c3f4150..cddf0c6 100644 --- a/ld/testsuite/ld-elfvers/vers22a.sym +++ b/ld/testsuite/ld-elfvers/vers22a.sym @@ -1 +1 @@ -[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0 +[0-9a-f]+ +g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0 diff --git a/ld/testsuite/ld-elfvers/vers23a.c b/ld/testsuite/ld-elfvers/vers23a.c index 13c8edd..9edbba3 100644 --- a/ld/testsuite/ld-elfvers/vers23a.c +++ b/ld/testsuite/ld-elfvers/vers23a.c @@ -1,6 +1,6 @@ #include "vers.h" -SYMVER(_old_bar, bar@VERS.0); +FUNC_SYMVER(_old_bar, bar@VERS.0); void _old_bar (void) diff --git a/ld/testsuite/ld-elfvers/vers23a.sym b/ld/testsuite/ld-elfvers/vers23a.sym index c3f4150..cddf0c6 100644 --- a/ld/testsuite/ld-elfvers/vers23a.sym +++ b/ld/testsuite/ld-elfvers/vers23a.sym @@ -1 +1 @@ -[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0 +[0-9a-f]+ +g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?bar@VERS.0 diff --git a/ld/testsuite/ld-elfvers/vers27d.sym b/ld/testsuite/ld-elfvers/vers27d.sym index d20bd1d..9133ed0 100644 --- a/ld/testsuite/ld-elfvers/vers27d.sym +++ b/ld/testsuite/ld-elfvers/vers27d.sym @@ -1 +1 @@ -[0-9a-f]+[ ]+g[ ]+F[ ]+\.(text|opd)[ ]+[0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0 +[0-9a-f]+ +g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS\.0 diff --git a/ld/testsuite/ld-elfvers/vers27d1.c b/ld/testsuite/ld-elfvers/vers27d1.c index 107e1c1..00fab8d 100644 --- a/ld/testsuite/ld-elfvers/vers27d1.c +++ b/ld/testsuite/ld-elfvers/vers27d1.c @@ -5,4 +5,4 @@ foo () { } -SYMVER(foo, foo@VERS.0); +FUNC_SYMVER(foo, foo@VERS.0); diff --git a/ld/testsuite/ld-elfvers/vers4.c b/ld/testsuite/ld-elfvers/vers4.c index 46ac432..eed0595 100644 --- a/ld/testsuite/ld-elfvers/vers4.c +++ b/ld/testsuite/ld-elfvers/vers4.c @@ -22,7 +22,7 @@ new_foo() } -SYMVER(new_foo, foo@@VERS_2.0); +FUNC_SYMVER(new_foo, foo@@VERS_2.0); int main() diff --git a/ld/testsuite/ld-elfvers/vers4.sym b/ld/testsuite/ld-elfvers/vers4.sym index c48d1bb..6511fc3 100644 --- a/ld/testsuite/ld-elfvers/vers4.sym +++ b/ld/testsuite/ld-elfvers/vers4.sym @@ -1 +1 @@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0 diff --git a/ld/testsuite/ld-elfvers/vers4a.sym b/ld/testsuite/ld-elfvers/vers4a.sym index c48d1bb..6511fc3 100644 --- a/ld/testsuite/ld-elfvers/vers4a.sym +++ b/ld/testsuite/ld-elfvers/vers4a.sym @@ -1 +1 @@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_2\.0 diff --git a/ld/testsuite/ld-elfvers/vers5.c b/ld/testsuite/ld-elfvers/vers5.c index 3cae67e..8b1b536 100644 --- a/ld/testsuite/ld-elfvers/vers5.c +++ b/ld/testsuite/ld-elfvers/vers5.c @@ -41,10 +41,10 @@ new_foo() } -SYMVER(original_foo, foo@); -SYMVER(old_foo, foo@VERS_1.1); -SYMVER(old_foo1, foo@VERS_1.2); -SYMVER(new_foo, foo@@VERS_1.2); +FUNC_SYMVER(original_foo, foo@); +FUNC_SYMVER(old_foo, foo@VERS_1.1); +FUNC_SYMVER(old_foo1, foo@VERS_1.2); +FUNC_SYMVER(new_foo, foo@@VERS_1.2); int main () diff --git a/ld/testsuite/ld-elfvers/vers6.c b/ld/testsuite/ld-elfvers/vers6.c index cb1c93f..5b72626 100644 --- a/ld/testsuite/ld-elfvers/vers6.c +++ b/ld/testsuite/ld-elfvers/vers6.c @@ -20,7 +20,7 @@ main() return 0; } -SYMVER(foo_1, show_foo@); -SYMVER(foo_2, show_foo@VERS_1.1); -SYMVER(foo_3, show_foo@VERS_1.2); -SYMVER(foo_4, show_foo@VERS_2.0); +FUNC_SYMVER(foo_1, show_foo@); +FUNC_SYMVER(foo_2, show_foo@VERS_1.1); +FUNC_SYMVER(foo_3, show_foo@VERS_1.2); +FUNC_SYMVER(foo_4, show_foo@VERS_2.0); diff --git a/ld/testsuite/ld-elfvers/vers6.sym b/ld/testsuite/ld-elfvers/vers6.sym index ae68d72..10a3966 100644 --- a/ld/testsuite/ld-elfvers/vers6.sym +++ b/ld/testsuite/ld-elfvers/vers6.sym @@ -1,4 +1,4 @@ -0+ *F? *\*UND\* 0+ _?show_foo@ -0+ *F? *\*UND\* 0+ _?show_foo@VERS_1\.1 -0+ *F? *\*UND\* 0+ _?show_foo@VERS_1\.2 -0+ *F? *\*UND\* 0+ _?show_foo@VERS_2\.0 +0+ *F? *\*UND\* 0+ \.?_?show_foo@ +0+ *F? *\*UND\* 0+ \.?_?show_foo@VERS_1\.1 +0+ *F? *\*UND\* 0+ \.?_?show_foo@VERS_1\.2 +0+ *F? *\*UND\* 0+ \.?_?show_foo@VERS_2\.0 diff --git a/ld/testsuite/ld-elfvers/vers7a.c b/ld/testsuite/ld-elfvers/vers7a.c index f3d2a2d..8fcad79 100644 --- a/ld/testsuite/ld-elfvers/vers7a.c +++ b/ld/testsuite/ld-elfvers/vers7a.c @@ -16,5 +16,5 @@ __b_internal (int e) return e + 42; } -SYMVER(__a_internal, hide_a@@VERS_1); -SYMVER(__b_internal, show_b@@VERS_1); +FUNC_SYMVER(__a_internal, hide_a@@VERS_1); +FUNC_SYMVER(__b_internal, show_b@@VERS_1); diff --git a/ld/testsuite/ld-elfvers/vers7a.sym b/ld/testsuite/ld-elfvers/vers7a.sym index ef8d04b..8b37561 100644 --- a/ld/testsuite/ld-elfvers/vers7a.sym +++ b/ld/testsuite/ld-elfvers/vers7a.sym @@ -1,2 +1,2 @@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?hide_a@@VERS_1 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_b@@VERS_1 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?hide_a@@VERS_1 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?show_b@@VERS_1 diff --git a/ld/testsuite/ld-elfvers/vers9.c b/ld/testsuite/ld-elfvers/vers9.c index 5079364..f70b0af 100644 --- a/ld/testsuite/ld-elfvers/vers9.c +++ b/ld/testsuite/ld-elfvers/vers9.c @@ -43,7 +43,7 @@ main() return 0; } -SYMVER(original_foo, foo@); -SYMVER(old_foo, foo@VERS_1.1); -SYMVER(old_foo1, foo@VERS_1.2); -SYMVER(new_foo, foo@@VERS_1.2); +FUNC_SYMVER(original_foo, foo@); +FUNC_SYMVER(old_foo, foo@VERS_1.1); +FUNC_SYMVER(old_foo1, foo@VERS_1.2); +FUNC_SYMVER(new_foo, foo@@VERS_1.2); diff --git a/ld/testsuite/ld-elfvers/vers9.sym b/ld/testsuite/ld-elfvers/vers9.sym index 2d46c47..28afa0d 100644 --- a/ld/testsuite/ld-elfvers/vers9.sym +++ b/ld/testsuite/ld-elfvers/vers9.sym @@ -1,4 +1,4 @@ -0+ *F? *\*UND\* 0+ _?foo@VERS_1\.2 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@ -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@@VERS_1\.2 -[0-9a-f]+ g +F \.(text|opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS_1\.1 +0+ *F? *\*UND\* 0+ \.?_?foo@VERS_1\.2 +[0-9a-f]+ g(F +\.text|F? +\.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@@VERS_1\.2 +[0-9a-f]+ g(F +\.text|F? +\.opd) [0-9a-f]+ (0x[0-9a-f]+ )?_?foo@VERS_1\.1 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 diff --git a/ld/testsuite/ld-ifunc/pr16467b.c b/ld/testsuite/ld-ifunc/pr16467b.c index 264f6cf..20a73e2 100644 --- a/ld/testsuite/ld-ifunc/pr16467b.c +++ b/ld/testsuite/ld-ifunc/pr16467b.c @@ -1,5 +1,8 @@ void new_sd_get_seats(void); __asm__(".symver new_sd_get_seats,sd_get_seats@LIBSYSTEMD_209"); +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +__asm__(".symver .new_sd_get_seats,.sd_get_seats@LIBSYSTEMD_209"); +#endif void (*resolve_sd_get_seats(void)) (void) __asm__ ("sd_get_seats"); void (*resolve_sd_get_seats(void)) (void) { return new_sd_get_seats; diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index 29f2117..4c853fd 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -149,7 +149,7 @@ set lto_link_tests [list \ {pr12760b.c} {} "libpr12760.a"] \ [list "PR ld/12760" \ "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12760a.o -Wl,--start-group tmpdir/libpr12760.a -Wl,--end-group" "" \ - {dummy.c} {} "pr12760.exe" "c" "pr12760a.c:6: warning: Bad bar"] \ + {dummy.c} {} "pr12760.exe" "c" "pr12760a.c:6: warning: Bad \\.?bar"] \ [list "Build libpr13183.a" \ "-T" "-flto -O2 $lto_fat" \ {pr13183a.c} {} "libpr13183.a"] \ @@ -392,21 +392,21 @@ if { [is_elf_format] && [check_lto_shared_available] } { run_cc_link_tests $lto_link_elf_tests set testname "PR ld/15146 (2)" set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin -Wl,-rpath-link,. -Wl,--no-copy-dt-needed-entries -Wl,--no-as-needed tmpdir/pr15146d.o tmpdir/pr15146c.so"] - if { [ regexp "undefined reference to symbol 'xxx'" $exec_output ] } { + if { [ regexp "undefined reference to symbol '\\.?xxx'" $exec_output ] } { pass $testname } { fail $testname } set testname "PR ld/16746 (3)" set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin tmpdir/pr16746b.o tmpdir/pr16746d.o"] - if { [ regexp "warning: foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { + if { [ regexp "warning: \\.?foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { pass $testname } { fail $testname } set testname "PR ld/16746 (4)" set exec_output [run_host_cmd "$CC" "-O2 -flto -fuse-linker-plugin tmpdir/pr16746d.o tmpdir/pr16746b.o"] - if { [ regexp "warning: foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { + if { [ regexp "warning: \\.?foobar" $exec_output ] && ![ regexp "symbol from plugin" $exec_output ] } { pass $testname } { fail $testname @@ -455,7 +455,7 @@ if { [at_least_gcc_version 4 7] } { } set testname "PR ld/12942 (3)" set exec_output [run_host_cmd "$CXX" "-O2 -flto -fuse-linker-plugin tmpdir/pr12942b.o tmpdir/pr12942a.o"] - if { [ regexp "undefined reference to `link_error\\(\\)'" $exec_output ] } { + if { [ regexp "undefined reference to `\\.?link_error\\(\\)'" $exec_output ] } { pass $testname } { fail $testname @@ -492,7 +492,7 @@ proc pr20103 {cflags libs} { set testname "PR ld/20103 ($cflags $libs)" set exec_output [run_host_cmd "$CC" "$cflags $libs"] - if { [ regexp "undefined reference to `dead'" $exec_output ] } { + if { [ regexp "undefined reference to `\\.?dead'" $exec_output ] } { pass "$testname (1)" } { fail "$testname (1)" diff --git a/ld/testsuite/ld-plugin/plugin-13.d b/ld/testsuite/ld-plugin/plugin-13.d index ebfdc11..55dea65 100644 --- a/ld/testsuite/ld-plugin/plugin-13.d +++ b/ld/testsuite/ld-plugin/plugin-13.d @@ -23,5 +23,5 @@ hook called: claim_file tmpdir/main.o \[@0/.* not claimed hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' #... diff --git a/ld/testsuite/ld-plugin/plugin-14.d b/ld/testsuite/ld-plugin/plugin-14.d index 96e1703..c9dc5f2 100644 --- a/ld/testsuite/ld-plugin/plugin-14.d +++ b/ld/testsuite/ld-plugin/plugin-14.d @@ -28,6 +28,6 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... hook called: all symbols read. tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin-15.d b/ld/testsuite/ld-plugin/plugin-15.d index ec7e52c..0481c5f 100644 --- a/ld/testsuite/ld-plugin/plugin-15.d +++ b/ld/testsuite/ld-plugin/plugin-15.d @@ -29,6 +29,6 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... hook called: all symbols read. tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin-16.d b/ld/testsuite/ld-plugin/plugin-16.d index 479785e..ae54f0c 100644 --- a/ld/testsuite/ld-plugin/plugin-16.d +++ b/ld/testsuite/ld-plugin/plugin-16.d @@ -33,6 +33,6 @@ hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin-20.d b/ld/testsuite/ld-plugin/plugin-20.d index dbee504..373a3ff 100644 --- a/ld/testsuite/ld-plugin/plugin-20.d +++ b/ld/testsuite/ld-plugin/plugin-20.d @@ -3,5 +3,5 @@ Input: func.c \(tmpdir/libfunc.a\) Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. diff --git a/ld/testsuite/ld-plugin/plugin-21.d b/ld/testsuite/ld-plugin/plugin-21.d index ebfa6c5..7b922c1 100644 --- a/ld/testsuite/ld-plugin/plugin-21.d +++ b/ld/testsuite/ld-plugin/plugin-21.d @@ -3,5 +3,5 @@ Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. diff --git a/ld/testsuite/ld-plugin/plugin-22.d b/ld/testsuite/ld-plugin/plugin-22.d index 07a47ac..1512676 100644 --- a/ld/testsuite/ld-plugin/plugin-22.d +++ b/ld/testsuite/ld-plugin/plugin-22.d @@ -3,5 +3,5 @@ hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. diff --git a/ld/testsuite/ld-plugin/plugin-23.d b/ld/testsuite/ld-plugin/plugin-23.d index 45e4052..e05f7bd 100644 --- a/ld/testsuite/ld-plugin/plugin-23.d +++ b/ld/testsuite/ld-plugin/plugin-23.d @@ -3,5 +3,5 @@ hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. diff --git a/ld/testsuite/ld-plugin/plugin-6.d b/ld/testsuite/ld-plugin/plugin-6.d index 07e54c6..b4a1e9c 100644 --- a/ld/testsuite/ld-plugin/plugin-6.d +++ b/ld/testsuite/ld-plugin/plugin-6.d @@ -28,6 +28,6 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... hook called: all symbols read. tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin-7.d b/ld/testsuite/ld-plugin/plugin-7.d index d1c159c..54259db 100644 --- a/ld/testsuite/ld-plugin/plugin-7.d +++ b/ld/testsuite/ld-plugin/plugin-7.d @@ -29,6 +29,6 @@ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... hook called: all symbols read. tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin-8.d b/ld/testsuite/ld-plugin/plugin-8.d index 2c7a15b..c1dd25a 100644 --- a/ld/testsuite/ld-plugin/plugin-8.d +++ b/ld/testsuite/ld-plugin/plugin-8.d @@ -33,6 +33,6 @@ hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY tmpdir/main.o: In function `main': -.*main.c.*: undefined reference to `func' +.*main.c.*: undefined reference to `\.?func' hook called: cleanup. #... diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index a6946c4..9990e82 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -106,12 +106,16 @@ if { $can_compile && \ set failed_compile 1 } +set dotsym 0 if { $can_compile && !$failed_compile } { # Find out if symbols have prefix on this platform before setting tests. catch "exec $NM tmpdir/func.o" plugin_nm_output if { [regexp "_func" "$plugin_nm_output"] } { set _ "_" } + if { [regexp "\\.func" "$plugin_nm_output"] } { + set dotsym 1 + } } set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o" @@ -121,6 +125,9 @@ set testsrcfiles_notext "tmpdir/main.o $srcdir/$subdir/func.c" # Rather than having libs we just define dummy values for anything # we may need to link a target exe; we aren't going to run it anyway. set libs "[ld_simple_link_defsyms] --defsym ${_}printf=${_}main --defsym ${_}puts=${_}main" +if { $dotsym } { + append libs " --defsym .printf=.main --defsym .puts=.main" +} set plugin_tests [list \ [list "load plugin" "-plugin $plugin_path \ diff --git a/ld/testsuite/ld-plugin/pr12760b.c b/ld/testsuite/ld-plugin/pr12760b.c index 29a9fd8..56bc3cf 100644 --- a/ld/testsuite/ld-plugin/pr12760b.c +++ b/ld/testsuite/ld-plugin/pr12760b.c @@ -1,7 +1,8 @@ -#define linker_warning(x, msg) \ - static const char __warn_##x[] \ - __attribute__((used, section(".gnu.warning." #x))) \ - = msg - -void bar (void) {} -linker_warning(bar, "Bad bar"); +void bar (void) {} +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +static const char __warn_bar[] +__attribute__ ((used, section (".gnu.warning..bar"))) = "Bad bar"; +#else +static const char __warn_bar[] +__attribute__ ((used, section (".gnu.warning.bar"))) = "Bad bar"; +#endif diff --git a/ld/testsuite/ld-plugin/pr16746a.c b/ld/testsuite/ld-plugin/pr16746a.c index 1705ef1..425cffa 100644 --- a/ld/testsuite/ld-plugin/pr16746a.c +++ b/ld/testsuite/ld-plugin/pr16746a.c @@ -1,3 +1,7 @@ +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX static const char __evoke_link_warning_foobar[] - __attribute__ ((used, section (".gnu.warning.foobar\n\t#"))) - = "foobar"; +__attribute__ ((used, section (".gnu.warning..foobar\n\t#"))) = "foobar"; +#else +static const char __evoke_link_warning_foobar[] +__attribute__ ((used, section (".gnu.warning.foobar\n\t#"))) = "foobar"; +#endif diff --git a/ld/testsuite/ld-plugin/pr16746b.c b/ld/testsuite/ld-plugin/pr16746b.c index c3b7a78..5db5d1d 100644 --- a/ld/testsuite/ld-plugin/pr16746b.c +++ b/ld/testsuite/ld-plugin/pr16746b.c @@ -1,5 +1,11 @@ +#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX +static const char __evoke_link_warning_foobar[] + __attribute__ ((used, section (".gnu.warning..foobar\n\t#"))) + = "foobar"; +#else static const char __evoke_link_warning_foobar[] __attribute__ ((used, section (".gnu.warning.foobar\n\t#"))) = "foobar"; +#endif void foobar (void) {} |