+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
}
asm (".symver foo,foo@FOO");
+#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
+asm (".symver .foo,.foo@FOO");
+#endif
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)
}
asm (".symver foo,foo@FOO");
+#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
+asm (".symver .foo,.foo@FOO");
+#endif
}
asm (".symver foo2,foo@@FOO2");
+#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
+asm (".symver .foo2,.foo@@FOO2");
+#endif
void
foo1 (void)
}
asm (".symver foo1,foo@FOO1");
+#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
+asm (".symver .foo1,.foo@FOO1");
+#endif
}
__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))
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
}
asm (".symver foo,foo@FOO");
+#if defined __powerpc64__ && defined _CALL_AIXDESC && !defined _CALL_LINUX
+asm (".symver .foo,.foo@FOO");
+#endif
}
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
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]
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 {
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
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 {
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
/* 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
}
-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);
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
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
bar33();
}
-SYMVER(bar33, bar@@VERS_2.0);
+FUNC_SYMVER(bar33, bar@@VERS_2.0);
#endif
-[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
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);
-[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
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);
-[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
#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 ()
return 1;
}
-int
+int __attribute__ ((weak))
_old_bar ()
{
return bar ();
-[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
#include "vers.h"
-SYMVER(_old_bar, bar@VERS.0);
+FUNC_SYMVER(_old_bar, bar@VERS.0);
void
_old_bar ()
-[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
#include "vers.h"
-SYMVER(_old_bar, bar@VERS.0);
+FUNC_SYMVER(_old_bar, bar@VERS.0);
void
_old_bar (void)
-[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
-[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
{
}
-SYMVER(foo, foo@VERS.0);
+FUNC_SYMVER(foo, foo@VERS.0);
}
-SYMVER(new_foo, foo@@VERS_2.0);
+FUNC_SYMVER(new_foo, foo@@VERS_2.0);
int
main()
-[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
-[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
}
-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 ()
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);
-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
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);
-[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
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);
-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
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 {
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
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 {
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
-[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
-[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
-[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
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;
{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"] \
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
}
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
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)"
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'
#...
#...
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.
#...
#...
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.
#...
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.
#...
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.
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.
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.
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.
#...
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.
#...
#...
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.
#...
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.
#...
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"
# 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 \
-#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
+#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
+#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) {}