ld testsuite fails with default-PIE compiler
authorAlan Modra <amodra@gmail.com>
Wed, 3 Jun 2020 13:39:48 +0000 (23:09 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 4 Jun 2020 00:50:48 +0000 (10:20 +0930)
* 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
ld/testsuite/ld-plugin/lto.exp
ld/testsuite/ld-unique/unique.exp

index a0d759797c24a74355e70304951d4f854268d5b6..363685d39c65bffdd932a160da2b5588d9025939 100644 (file)
@@ -1,3 +1,9 @@
+2020-06-04  Alan Modra  <amodra@gmail.com>
+
+       * 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  <hongjiu.lu@intel.com>
 
        * testsuite/config/default.exp (NOSANTIZE_CFLAGS): New.
index d888854e1f2cef02b8175cd2dba11405ec54b6c4..5bd4c5f09b7bc04e9fd50bbd3ba7a3a2efb477fa 100644 (file)
@@ -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" \
index 6f2112c5d79cf886283c4061191cf7f2dba3e0e0..a7f7e690776bede3e0ea1742d57ef8d2a58178eb 100644 (file)
@@ -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]
 }