From a2076b34e146a1f181ef58b5954815571fbcd6c6 Mon Sep 17 00:00:00 2001 From: Senthil Kumar Selvaraj Date: Tue, 3 May 2016 10:44:35 +0100 Subject: [PATCH] Skip ELF STT_COMMON linker tests if shared libraries are not supported. * testsuite/ld-elfcomm/elfcomm.exp: Check for shared lib support before running STT_COMMON tests. --- ld/ChangeLog | 5 +++++ ld/testsuite/ld-elfcomm/elfcomm.exp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index aecf58162cf..92596b7fe61 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2016-05-03 Senthil Kumar Selvaraj + + * testsuite/ld-elfcomm/elfcomm.exp: Check for shared lib support + before running STT_COMMON tests. + 2016-04-29 H.J. Lu * config/default.exp (NOPIE_CFLAGS): Download source only on diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp index 926b98ce7a0..fd32e02ed7a 100644 --- a/ld/testsuite/ld-elfcomm/elfcomm.exp +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp @@ -246,6 +246,14 @@ if { [dump_common1 $test1c2] } { # # The following tests are for when we are generating STT_COMMON symbols only. # +# Handling of -z common and -z nocommon flags is enabled only if +# $GENERATE_SHLIB_SCRIPT is turned on in emulparams i.e. shared +# libraries are supported. + +if ![check_shared_lib_support] { + return +} + stt_common_test "-static -e 0" "static link of common symbols" stt_common_test "-shared" "shared link of common symbols" stt_common_test "-pie" "position independent link of common symbols" -- 2.30.2