This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PING: [PATCH] Run vismain only if linker supports protected data symbol
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 4 Aug 2017 06:32:56 -0700
- Subject: Re: PING: [PATCH] Run vismain only if linker supports protected data symbol
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOpF3wD04_cx4bS+CSH__qkwCeH2aeHndWJgzmBNMrDd6Q@mail.gmail.com> <CAMe9rOqw4JWrh8pRx7AwYDnnx4b1S4QZ=x1OFciig55KzBgkyA@mail.gmail.com>
On Wed, Aug 2, 2017 at 7:48 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, Jun 28, 2017 at 11:15 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Mon, Jun 26, 2017 at 12:54 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>> 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?
>>
>> PING.
>
> Any objections?
>
>>> 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)))
>>>
>>> --
>>> 2.9.4
>>>
>>
>>
>>
>> --
>> H.J.
>
>
I am checking it in today.
H.J.