PowerPC64 dot-sym testsuite fixes
authorAlan Modra <amodra@gmail.com>
Sat, 3 Dec 2016 10:29:43 +0000 (20:59 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 3 Dec 2016 10:29:43 +0000 (20:59 +1030)
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.

56 files changed:
ld/ChangeLog
ld/testsuite/ld-elf/indirect1b.c
ld/testsuite/ld-elf/indirect2.c
ld/testsuite/ld-elf/indirect3b.c
ld/testsuite/ld-elf/indirect4b.c
ld/testsuite/ld-elf/pr18718.c
ld/testsuite/ld-elf/pr18720b.c
ld/testsuite/ld-elf/pr19553c.c
ld/testsuite/ld-elf/shared.exp
ld/testsuite/ld-elfvers/vers.exp
ld/testsuite/ld-elfvers/vers.h
ld/testsuite/ld-elfvers/vers1.c
ld/testsuite/ld-elfvers/vers1.sym
ld/testsuite/ld-elfvers/vers15.c
ld/testsuite/ld-elfvers/vers15.sym
ld/testsuite/ld-elfvers/vers18.c
ld/testsuite/ld-elfvers/vers18.sym
ld/testsuite/ld-elfvers/vers21.c
ld/testsuite/ld-elfvers/vers21.sym
ld/testsuite/ld-elfvers/vers22a.c
ld/testsuite/ld-elfvers/vers22a.sym
ld/testsuite/ld-elfvers/vers23a.c
ld/testsuite/ld-elfvers/vers23a.sym
ld/testsuite/ld-elfvers/vers27d.sym
ld/testsuite/ld-elfvers/vers27d1.c
ld/testsuite/ld-elfvers/vers4.c
ld/testsuite/ld-elfvers/vers4.sym
ld/testsuite/ld-elfvers/vers4a.sym
ld/testsuite/ld-elfvers/vers5.c
ld/testsuite/ld-elfvers/vers6.c
ld/testsuite/ld-elfvers/vers6.sym
ld/testsuite/ld-elfvers/vers7a.c
ld/testsuite/ld-elfvers/vers7a.sym
ld/testsuite/ld-elfvers/vers9.c
ld/testsuite/ld-elfvers/vers9.sym
ld/testsuite/ld-elfweak/elfweak.exp
ld/testsuite/ld-elfweak/strong.sym
ld/testsuite/ld-elfweak/strongcomm.sym
ld/testsuite/ld-elfweak/strongdata.sym
ld/testsuite/ld-ifunc/pr16467b.c
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-plugin/plugin-13.d
ld/testsuite/ld-plugin/plugin-14.d
ld/testsuite/ld-plugin/plugin-15.d
ld/testsuite/ld-plugin/plugin-16.d
ld/testsuite/ld-plugin/plugin-20.d
ld/testsuite/ld-plugin/plugin-21.d
ld/testsuite/ld-plugin/plugin-22.d
ld/testsuite/ld-plugin/plugin-23.d
ld/testsuite/ld-plugin/plugin-6.d
ld/testsuite/ld-plugin/plugin-7.d
ld/testsuite/ld-plugin/plugin-8.d
ld/testsuite/ld-plugin/plugin.exp
ld/testsuite/ld-plugin/pr12760b.c
ld/testsuite/ld-plugin/pr16746a.c
ld/testsuite/ld-plugin/pr16746b.c

index 86a4fce21b0ececdce0cc99deb53dca913428547..b1c6b8cd5144ecf573ad232aabf8e1717e80e4b5 100644 (file)
@@ -1,3 +1,69 @@
+2016-12-03  Alan Modra  <amodra@gmail.com>
+
+       * 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.
+
 2016-12-03  Alan Modra  <amodra@gmail.com>
 
        * testsuite/ld-elfvers/vers.exp (objdump_dynsymstuff): Don't abort
index 51740f90782452a1901d2f8c628f9926daf82f3a..60f34527f4107e30f10f7efcbd82715473ab118d 100644 (file)
@@ -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
index 6df29bed2d70b99b9ab4f0a39d009519a6530773..e36532d1e70acb80fd2840b371c5b347d91b29a5 100644 (file)
@@ -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)
index dbb37c3a80a6cc8ae2190fce34e3e0149f5498d6..74cc461f998277d3056a17e9b02610d01be9b561 100644 (file)
@@ -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
index b8db9d0807aca169ff5d3db38db66e01d6363422..06739b55ea8bc050b8bfd17f9d856d6ada27e0fb 100644 (file)
@@ -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
index 5ec1b9ebffbee79faebd94c61ca3acb27412f5af..9cf15e8c054010f135bf29449879de8ae6e9c4a0 100644 (file)
@@ -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))
index 90d376b68e932331614a89f4809aea41bfc057c9..6a2975dca76f3f04582cb1d730f209193ecbb523 100644 (file)
@@ -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
index d80dfc9fc3b8a7dea4d1f8cf1924f4c7b5dadbe0..7587b4afbe3a65563960005ba13107d1ea2bbabf 100644 (file)
@@ -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
index f3b6f18a09c28bd14400d741fe2db19fe88a0b71..f1d741f7be68232da5d481f6ed0654e6b2704f30 100644 (file)
@@ -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
index a2a678b924ea947e5231d698c4c225146e056142..4c423422a2246eeb1abe81c552e20d9041af5459 100644 (file)
@@ -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
index 4455527457ca65bb13815e80a6e218fc70a57570..00385f096e6fd083676997728cedd20ed030c9fb 100644 (file)
@@ -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
index 86e2bd2ba16157a3014fd822055c185a5eee800c..9813fd3f4cc0447473f7740f87718abe94e46ff7 100644 (file)
@@ -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
index 0196109c96cb87c7410f91dfa6d39e8ebddd2469..206863fd18fdc19dff216e09fb03cdf007670d73 100644 (file)
@@ -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
index 2457d29755596ee0a7abb79aa7024acdfe7d739f..a7c044a201a35446057d7a6d326ca03ecd0fc5f8 100644 (file)
@@ -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);
index fe56a2419b5f5970259ee0ba4121a4328a4255c2..ccf4f4d4b36f5ef8ddf6e1073517b626acda2e1d 100644 (file)
@@ -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
index 9965b88a02954172373ff151044ec17b26712de9..fe1017b67e36cd39f4adedbb8cda0e220c13cd18 100644 (file)
@@ -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);
index 62890d7ad512760beffa25ef706ac3eef60d2380..04fa49cf3b74d49fbe91fe3f07a80785697f666b 100644 (file)
@@ -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
index 3a75b48add1707214f785ca179dcdcda389420b9..4a994a19fee8cf82e17b8fb6ec2b1e45ada13089 100644 (file)
@@ -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 ();
index 271ca797e899a8631216d952f397db23ec7e6e4c..f5ade0b793576ae3769ba5399c1f9df12a5ba449 100644 (file)
@@ -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
index bc5777bb83c50bc1bdf79881c2fe87e38be066f4..9a5fcac816ea944655af690c5a859c30f3bdb6ff 100644 (file)
@@ -1,6 +1,6 @@
 #include "vers.h"
 
-SYMVER(_old_bar, bar@VERS.0);
+FUNC_SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar () 
index c3f4150ccaa4797060a2cddd1b7041f5aa182cac..cddf0c6cd9758d8b55a0484b2fe6bdd9db53d9db 100644 (file)
@@ -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
index 13c8edd6e3506c7170fb623061f69c93b02ee505..9edbba353b56e4b07a266a73592d781b79a0d3ba 100644 (file)
@@ -1,6 +1,6 @@
 #include "vers.h"
 
-SYMVER(_old_bar, bar@VERS.0);
+FUNC_SYMVER(_old_bar, bar@VERS.0);
 
 void
 _old_bar (void) 
index c3f4150ccaa4797060a2cddd1b7041f5aa182cac..cddf0c6cd9758d8b55a0484b2fe6bdd9db53d9db 100644 (file)
@@ -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
index d20bd1d23497859483eb1e2f0bba7472d47f7a29..9133ed0ab28e586345dbc11bb55f8b3830526a0c 100644 (file)
@@ -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
index 107e1c1de89b24bfcc75add0e7e6c128c23e4cd9..00fab8d46547a86167b54e947a34274c24f4759f 100644 (file)
@@ -5,4 +5,4 @@ foo ()
 {
 }
 
-SYMVER(foo, foo@VERS.0);
+FUNC_SYMVER(foo, foo@VERS.0);
index 46ac43258de86a8fa9ba4994d6ea7ed0e70b2cdc..eed059589ad3f6ae27a1678b7cfdcc13a2db2b6a 100644 (file)
@@ -22,7 +22,7 @@ new_foo()
 
 }
 
-SYMVER(new_foo, foo@@VERS_2.0);
+FUNC_SYMVER(new_foo, foo@@VERS_2.0);
 
 int
 main()
index c48d1bb09f1038fb902b889e1bc248e5a44314f4..6511fc36394ddcd943b15568ef238a29e3335def 100644 (file)
@@ -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
index c48d1bb09f1038fb902b889e1bc248e5a44314f4..6511fc36394ddcd943b15568ef238a29e3335def 100644 (file)
@@ -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
index 3cae67ebc924f6b23ee5d373a3bcc38ed572ae97..8b1b5360c8e4f0c7f2495f8c8795e078bbbddef7 100644 (file)
@@ -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 ()
index cb1c93f635a18e664166f4697bac0a916c1c2201..5b726269466dafb97e43094677db82d1637ca890 100644 (file)
@@ -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);
index ae68d724e201fb82b0a00e5017d9267a19662660..10a3966e4f128ed669df0afeed32bb37be1847c5 100644 (file)
@@ -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
index f3d2a2d989706ae51091457b9db5c96d29929123..8fcad79f679031e34b8d73fa15225b178a8b1380 100644 (file)
@@ -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);
index ef8d04be0bbc28c81b0fd394b59d656dca992b4b..8b375614718927ab8271f6f4790012474203855a 100644 (file)
@@ -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
index 50793640915f98fb51c9b31b7a6a6050b0d4b5c0..f70b0af9ffd147b042f40024288012e7f59f8901 100644 (file)
@@ -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);
index 2d46c47c61e5c9f12c0f20b78298dd856b51b7fc..28afa0d8b9b6ef3056aac00d881ebd255d07368a 100644 (file)
@@ -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
index 31801eb60a38876b457ffda7c41f0bb1135cb01e..d3037e132985a509dbb0c369e4568f0ac62f37ba 100644 (file)
@@ -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
index 531d35876f721789308af6bac5b7d43e56ed0aaf..27d0daa308e0c2053e41e938740a6af3dc0d9d80 100644 (file)
@@ -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
index 2a8c6cd2872a522646743140c32502c524793ae5..c5fe85c95b89fdf1caee10cfd0d1dfbffb9f891f 100644 (file)
@@ -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
index 88aa1c9def710144fcb1dc18744ae7a73edbff3a..d09722ad57c053e8b06e3a72e23f474a0ce866c9 100644 (file)
@@ -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
index 264f6cff85911614b5f462f87115caddaad4f893..20a73e25a420983131f7f17cd853a73d6ce11d9d 100644 (file)
@@ -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;
index 29f211712e6c97a6d70830e1b68a8afc0cdd5091..4c853fdedd9902f3b1e6279d1bd8264e4e5cac5b 100644 (file)
@@ -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)"
index ebfdc116eb31411fcebcd1e951586495fb72160b..55dea651ec555861e0e0c41529a37d8785f6e502 100644 (file)
@@ -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'
 #...
index 96e17030812a7fa12487d64dff8e0a7efa4baa79..c9dc5f231f5f9563bfddf99b8344ced0e6084d39 100644 (file)
@@ -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.
 #...
index ec7e52c2a9131ac4a25a77530a34395ae9a8b9b9..0481c5fb054b257410716c5a49b4a045e280e4ce 100644 (file)
@@ -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.
 #...
index 479785e96d7e0bb4adccc18996456330b2cf5c14..ae54f0c24a1b90686e17ffc31e5dc4ab331e1e2c 100644 (file)
@@ -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.
 #...
index dbee504f916ddfda0c2a9f2eb5e7ed2514ea534c..373a3ff2a3b037c1959710654c17a3c4008cd8a6 100644 (file)
@@ -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.
index ebfa6c5175f7e801d3a6d7c645bed470de952012..7b922c11e116f9f081f70782b7bdbcafb8a666bc 100644 (file)
@@ -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.
index 07a47acbe2b76166b17012e20de57abdf3e9cada..151267624f906a95d030e85efb99169810d26642 100644 (file)
@@ -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.
index 45e405247f1b772376093d9776af65b0955d89e7..e05f7bdfcf75a94331beca610b6aac122996d9c2 100644 (file)
@@ -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.
index 07e54c6c2140e72c28bfdbee2a7571d17c0e54d6..b4a1e9cee847d1bebb66748a5941842f696329b7 100644 (file)
@@ -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.
 #...
index d1c159c4f311d6164965d79cb28a7b3c030f3375..54259db7dc6ff90ccc7db0669f95f6475c92b7ad 100644 (file)
@@ -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.
 #...
index 2c7a15b24142824bb9985f34bf43a7aaa7353d9e..c1dd25ad66302582970c7301f964e95542c1015a 100644 (file)
@@ -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.
 #...
index a6946c47c2e878500c1e3c4d4029989f5be8d8ad..9990e82d3e1077c5bd647a06ef4f72cbf0a07017 100644 (file)
@@ -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 \
index 29a9fd89ef1e66a7ad88297dda8f4c5fc38ad778..56bc3cf892ffd942f116baaa3f742961ff08b99f 100644 (file)
@@ -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
index 1705ef1a9856ab883a5e7964ec1f2076501d016a..425cffa34ff332b3010a70088dffcc75948dbbf1 100644 (file)
@@ -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
index c3b7a78d3312ae54d12771c8b939a3848b03482e..5db5d1d4eb6611b2dbe30dc771158123a02d3d63 100644 (file)
@@ -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) {}