From 60f207b4a9599bde4050ee683d99bbd9b0f57278 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 3 Jun 2020 23:09:48 +0930 Subject: [PATCH] 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. --- ld/ChangeLog | 6 ++++++ ld/testsuite/ld-plugin/lto.exp | 2 +- ld/testsuite/ld-unique/unique.exp | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index a0d759797c2..363685d39c6 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 d888854e1f2..5bd4c5f09b7 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 6f2112c5d79..a7f7e690776 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] } -- 2.30.2