From patchwork Mon Jun 26 19:54:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lu, Hongjiu" X-Patchwork-Id: 21268 Received: (qmail 96355 invoked by alias); 26 Jun 2017 19:54:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 96341 invoked by uid 89); 26 Jun 2017 19:54:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga03.intel.com X-ExtLoop1: 1 Date: Mon, 26 Jun 2017 12:54:10 -0700 From: "H.J. Lu" To: GNU C Library Subject: [PATCH] Run vismain only if linker supports protected data symbol Message-ID: <20170626195410.GA7943@gmail.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.0 (2017-02-23) Gold doesn't support protected data symbol: configure:5672: checking linker support for protected data symbol configure:5682: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector -fPIC -shared conftest.c -o conftest.so configure:5685: $? = 0 configure:5692: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector conftest.c -o conftest conftest.so /usr/local/bin/ld.gold: error: /tmp/ccXWoofs.o: cannot make copy relocation for protected symbol 'bar', defined in conftest.so collect2: error: ld returned 1 exit status Run vismain only if linker supports protected data symbol. Any comments? H.J. * elf/Makefile (tests): Add vismain only if $(have-protected-data) == yes. (tests-pie): Likewise. --- elf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elf/Makefile b/elf/Makefile index 201b328..62084b4 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -289,10 +289,12 @@ ifeq (yesyes,$(have-fpie)$(build-shared)) modules-names += tst-piemod1 tests += tst-pie1 tst-pie2 tests-pie += tst-pie1 tst-pie2 +ifeq (yes,$(have-protected-data)) tests += vismain tests-pie += vismain CFLAGS-vismain.c = $(PIE-ccflag) endif +endif modules-execstack-yes = tst-execstack-mod extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))