]> sourceware.org Git - glibc.git/commitdiff
Run vismain only if linker supports protected data symbol
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 4 Aug 2017 18:47:08 +0000 (11:47 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 4 Aug 2017 18:47:23 +0000 (11:47 -0700)
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.

* elf/Makefile (tests): Add vismain only if
$(have-protected-data) == yes.
(tests-pie): Likewise.

ChangeLog
elf/Makefile

index 613db927a3917ecb71bfd7fb6a11d3ca956aa501..33caac763ccd727a0e74b4e01d144c82f33f24d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-04  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf/Makefile (tests): Add vismain only if
+       $(have-protected-data) == yes.
+       (tests-pie): Likewise.
+
 2017-08-04  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #21871]
index e758a4c96002ee44ec28a0358b567bcc241c1060..2956445de88885263d1da513e702e3c29206dc1e 100644 (file)
@@ -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)))
 
This page took 0.048413 seconds and 5 git commands to generate.