diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 15:22:05 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-06-21 15:22:05 -0700 |
commit | 6b7373708821500a7388a8248b6c19fa1826c514 (patch) | |
tree | 5e67a3b44a2ade1f52b72faa901259fbb396e638 /ld/testsuite/ld-elf | |
parent | e5c89b096d9cb9e5956e98cd5863519c87c6890b (diff) | |
download | gdb-6b7373708821500a7388a8248b6c19fa1826c514.zip gdb-6b7373708821500a7388a8248b6c19fa1826c514.tar.gz gdb-6b7373708821500a7388a8248b6c19fa1826c514.tar.bz2 |
Pass $NOPIE_CFLAGS and $NOPIE_LDFLAGS to some ELF tests
Some ELF tests will fail when PIE is used.
PR ld/21090
* testsuite/ld-elf/shared.exp: Pass $NOPIE_CFLAGS and
$NOPIE_LDFLAGS if non-PIE is required.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r-- | ld/testsuite/ld-elf/shared.exp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/ld/testsuite/ld-elf/shared.exp b/ld/testsuite/ld-elf/shared.exp index 7c4e0a2..8b139ec 100644 --- a/ld/testsuite/ld-elf/shared.exp +++ b/ld/testsuite/ld-elf/shared.exp @@ -31,6 +31,9 @@ if ![check_shared_lib_support] { return } +# Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required. +global NOPIE_CFLAGS NOPIE_LDFLAGS + # This target requires extra GAS options when building code for shared # libraries. set AFLAGS_PIC "" @@ -554,8 +557,8 @@ set dlopen_run_tests [list \ "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \ {dl6amain.c} "dl6a1" "dl6a.out" ] \ [list "Run dl6a2 with -Bsymbolic-functions and dlopen on libdl6a.so" \ - "-Wl,--no-as-needed,-Bsymbolic-functions $extralibs" "" \ - {dl6amain.c} "dl6a2" "dl6b.out" ] \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-Bsymbolic-functions $extralibs" "" \ + {dl6amain.c} "dl6a2" "dl6b.out" "$NOPIE_CFLAGS" ] \ [list "Run dl6a3 with -Bsymbolic and dlopen on libdl6a.so" \ "-Wl,--no-as-needed,-Bsymbolic $extralibs" "" \ {dl6amain.c} "dl6a3" "dl6b.out" ] \ @@ -563,14 +566,14 @@ set dlopen_run_tests [list \ "-Wl,--no-as-needed,-Bsymbolic,--dynamic-list-data $extralibs" "" \ {dl6amain.c} "dl6a4" "dl6a.out" ] \ [list "Run dl6a5 with -Bsymbolic-functions --dynamic-list-cpp-new and dlopen on libdl6a.so" \ - "-Wl,--no-as-needed,-Bsymbolic-functions,--dynamic-list-cpp-new $extralibs" "" \ - {dl6amain.c} "dl6a5" "dl6b.out" ] \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,-Bsymbolic-functions,--dynamic-list-cpp-new $extralibs" "" \ + {dl6amain.c} "dl6a5" "dl6b.out" "$NOPIE_CFLAGS" ] \ [list "Run dl6a6 with --dynamic-list-cpp-new -Bsymbolic-functions and dlopen on libdl6a.so" \ - "-Wl,--no-as-needed,--dynamic-list-cpp-new,-Bsymbolic-functions $extralibs" "" \ - {dl6amain.c} "dl6a6" "dl6b.out" ] \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,--dynamic-list-cpp-new,-Bsymbolic-functions $extralibs" "" \ + {dl6amain.c} "dl6a6" "dl6b.out" "$NOPIE_CFLAGS" ] \ [list "Run dl6a7 with --dynamic-list-data -Bsymbolic and dlopen on libdl6a.so" \ - "-Wl,--no-as-needed,--dynamic-list-data,-Bsymbolic $extralibs" "" \ - {dl6amain.c} "dl6a7" "dl6a.out" ] \ + "$NOPIE_LDFLAGS -Wl,--no-as-needed,--dynamic-list-data,-Bsymbolic $extralibs" "" \ + {dl6amain.c} "dl6a7" "dl6a.out" "$NOPIE_CFLAGS" ] \ [list "Run dl6b1 with --dynamic-list-data and dlopen on libdl6b.so" \ "-Wl,--no-as-needed,--dynamic-list-data $extralibs" "" \ {dl6bmain.c} "dl6b1" "dl6a.out" ] \ |