From: Alan Modra Date: Wed, 3 Jun 2020 13:39:48 +0000 (+0930) Subject: ld testsuite fails with default-PIE compiler X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=60f207b4a9599bde4050ee683d99bbd9b0f57278;p=deliverable%2Fbinutils-gdb.git ld testsuite fails with default-PIE compiler * testsuite/ld-plugin/lto.exp (pr12758.exe): Add NOPIE_LDFLAGS. * testsuite/ld-unique/unique.exp: Add NOPIE_LDFLAGS to unique executable and dynamic executable tests. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index a0d759797c..363685d39c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2020-06-04 Alan Modra + + * testsuite/ld-plugin/lto.exp (pr12758.exe): Add NOPIE_LDFLAGS. + * testsuite/ld-unique/unique.exp: Add NOPIE_LDFLAGS to unique + executable and dynamic executable tests. + 2020-06-03 H.J. Lu * testsuite/config/default.exp (NOSANTIZE_CFLAGS): New. diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp index d888854e1f..5bd4c5f09b 100644 --- a/ld/testsuite/ld-plugin/lto.exp +++ b/ld/testsuite/ld-plugin/lto.exp @@ -149,7 +149,7 @@ set lto_link_tests [list \ "" "-flto -O2 $lto_fat $NOSANTIZE_CFLAGS" \ {pr12758b.c} {} "libpr12758.a"] \ [list "PR ld/12758" \ - "-O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" \ + "$NOPIE_LDFLAGS -O2 -Wl,-e,foo -nostdlib -flto -fuse-linker-plugin tmpdir/pr12758a.o -Wl,--start-group tmpdir/libpr12758.a -Wl,--end-group" \ "$NOSANTIZE_CFLAGS" \ {dummy.c} {} "pr12758.exe"] \ [list "Compile PR ld/12760" \ diff --git a/ld/testsuite/ld-unique/unique.exp b/ld/testsuite/ld-unique/unique.exp index 6f2112c5d7..a7f7e69077 100644 --- a/ld/testsuite/ld-unique/unique.exp +++ b/ld/testsuite/ld-unique/unique.exp @@ -123,7 +123,7 @@ if [board_info [target_info name] exists cflags] { } # Create executable containing unique symbol. -if ![ld_link "$CC $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] { +if ![ld_link "$CC $NOPIE_LDFLAGS $board_cflags" "tmpdir/unique_prog" "tmpdir/unique.o"] { fail "Could not link a unique executable" set fails [expr $fails + 1] } @@ -202,7 +202,7 @@ if {![ld_link $ld "tmpdir/libunique_shared.so" "-shared tmpdir/unique_shared.o"] } # Create executable NOT containing unique symbol linked against library. -if {![ld_link "$CC $board_cflags" "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } { +if {![ld_link "$CC $NOPIE_LDFLAGS $board_cflags" "tmpdir/unique_shared_prog" "-Ltmpdir tmpdir/unique_empty.o -Wl,-Bdynamic,-rpath=./tmpdir -lunique_shared"] } { fail "Could not link a dynamic executable" set fails [expr $fails + 1] }