This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PING: [PATCH] Add --enable-static-pie to build static PIE
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>, nd at arm dot com, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 5 Oct 2017 16:36:26 -0700
- Subject: Re: PING: [PATCH] Add --enable-static-pie to build static PIE
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOqdAZkw6rAj16hnbURQVswbOAbseuK+cRfm7yzC6_ktOA@mail.gmail.com> <CAMe9rOp2jnA19-xU0PE=2410yHnyC9Hu_QMkD6wUaYi4rOBVTQ@mail.gmail.com> <alpine.DEB.2.20.1709262304200.29011@digraph.polyomino.org.uk> <CAMe9rOpSHD14xsK51DG7c+UzGptk4LFFCDM2_dbJ7cA1Quyfjg@mail.gmail.com> <alpine.DEB.2.20.1709271236341.19034@digraph.polyomino.org.uk> <CAMe9rOr268hmHGT4Eh1xYL+qeFg419zLbtDUkRbeJqrCkOWzKQ@mail.gmail.com> <alpine.DEB.2.20.1709280044520.32152@digraph.polyomino.org.uk> <CAMe9rOo3vAn-dzSLN_4cmScOT+-hTXaVFgf3LGM5NhJdtFOvMA@mail.gmail.com> <alpine.DEB.2.20.1709281300590.19741@digraph.polyomino.org.uk> <CAMe9rOrnw1-SeyT_FpPhgkHnZqKK_4Gtv-70w2ufbq_Hu9NP9A@mail.gmail.com> <CAMe9rOo3ACm7YKvnpAzX9w+a_scQRirTQ2QZy-BJhL3_p9Mkkw@mail.gmail.com> <59D64E44.6040304@arm.com>
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,
--
H.J.