diff options
Diffstat (limited to 'ld/testsuite/ld-plugin')
-rw-r--r-- | ld/testsuite/ld-plugin/lto.exp | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-13.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-14.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-15.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-16.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-20.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-21.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-22.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-23.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-6.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-7.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin-8.d | 2 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin.exp | 7 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr12760b.c | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr16746a.c | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/pr16746b.c | 6 |
16 files changed, 44 insertions, 26 deletions
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) {} |