PING: [PATCH] Add --enable-static-pie to build static PIE
H.J. Lu
hjl.tools@gmail.com
Thu Oct 12 22:07:00 GMT 2017
On 10/5/17, H.J. Lu <hjl.tools@gmail.com> wrote:
> On 10/5/17, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
>> On 05/10/17 14:11, H.J. Lu wrote:
>>> On 9/29/17, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> I submitted patches for other targets to address obvious issues with
>>>> static
>>>> PIE. Build results of build-many-glibcs.py with --enable-static-pie
>>>> with
>>>> all
>>>> patches for static PIE applied are
>>>>
>>>> PASS: glibcs-aarch64_be-linux-gnu build
>>>> PASS: glibcs-aarch64-linux-gnu build
>>
>> can you tell me the binutils version used?
>> building fails with recent binutils master:
>>
>> builddir/libc.a(dl-reloc-static-pie.o): In function
>> `elf_get_dynamic_info':
>> srcdir/elf/get-dynamic-info.h:73:(.text+0x4c): relocation truncated to
>> fit:
>> R_AARCH64_ADR_PREL_PG_HI21 against
>> symbol `_dl_main_map' defined in .data.rel.local section in
>> builddir/libc.a(dl-support.o)
>> srcdir/elf/get-dynamic-info.h:70:(.text+0x50): relocation truncated to
>> fit:
>> R_AARCH64_ADR_PREL_PG_HI21 against
>> symbol `_dl_main_map' defined in .data.rel.local section in
>> builddir/libc.a(dl-support.o)
>>
>> and
>>
>> $ objdump -t builddir/elf/dl-support.o
>> ...
>> 0000000000000000 g O .data.rel.local 0000000000000468 .hidden
>> _dl_main_map
>> ...
>> $ objdump -r builddir/elf/dl-reloc-static-pie.o
>> ...
>> 000000000000004c R_AARCH64_ADR_PREL_PG_HI21
>> _dl_main_map+0x000000037ffffa40
>> 0000000000000050 R_AARCH64_ADR_PREL_PG_HI21
>> _dl_main_map+0x000000037ffff1e0
>> ...
>>
>> those offsets look wrong, i'll need to investigate
>>
>>
>
> Did you mean addend? In any case, I checked a workaround
> into hjl/pie/static. Please give it a try,
Here is the updated patch. The main change is that gPcrt1.o is also added
to create static PIE with -pg.
OK for master?
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0011-Add-enable-static-pie-to-build-many-glibcs.py.patch
Type: text/x-patch
Size: 867 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20171012/078ed499/attachment.bin>
More information about the Libc-alpha
mailing list