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.
This commit is contained in:
Alan Modra 2020-06-03 23:09:48 +09:30
parent 7eea15c514
commit 60f207b4a9
3 changed files with 9 additions and 3 deletions

View 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.

View 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" \

View 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]
}