[PATCH v2] elf: Support DT_RELR relative relocation format [BZ #27924]
Carlos O'Donell
carlos@redhat.com
Fri Oct 29 19:35:56 GMT 2021
On 10/29/21 14:38, Fāng-ruì Sòng wrote:
> On Fri, Oct 29, 2021 at 11:21 AM Carlos O'Donell <carlos@redhat.com> wrote:
>>
>> On 10/16/21 20:50, Fangrui Song via Binutils wrote:
>>> PIE and shared objects usually have many relative relocations. In
>>> 2017/2018, SHT_RELR/DT_RELR was proposed on
>>> https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/GxjM0L-PBAAJ
>>> ("Proposal for a new section type SHT_RELR") and is a pre-standard. RELR
>>> usually takes 3% or smaller space than R_*_RELATIVE relocations. The
>>> virtual memory size of a mostly statically linked PIE is typically 5~10%
>>> smaller.
>>
>> We've been going over this patch on the weekly Monday patch queue review.
>>
>> I took a note to point out that one of the blockers here is that it is difficult
>> to immediately test this work because it requires a working glibc build using
>> ldd (which has support for DT_RELR).
>
> No:) There may be a misunderstanding.
>
> To test the feature: a DT_RELR executable is needed.
> Currently only ld.lld --pack-dyn-relocs=relr supports generating
> DT_RELR binaries,
> but glibc itself does not need to be linked with ld.lld.
This is true.
However, running the entire testsuite with ld.lld and DT_RELR gives wider coverage
and improves confidence in the feature.
> If the patch is accepted, GNU ld built glibc will support DT_RELR
> programs linked by ld.lld.
I agree, but in that scenario, lacking the ability to link the entire testsuite
with ld.lld reduces testing coverage for the feature.
>> What is the status of the lld support patches for glibc?
>
> aarch64 and x86-64 work well for me.
... but they aren't yet committed?
Do we have a patchwork series for them?
https://patchwork.sourceware.org/project/glibc/list/?series=4199
> Seems that Adhemerval may be interested in adding a lld configuration
> to scripts/build-many-glibcs.py
checking version of ld... 12.0.1, bad
...
configure: error:
*** These critical programs are missing or too old: LLD
*** Check the INSTALL file for required versions.
What's the fix for this?
>> If we made progress on the lld support then we'd be able to more easily review
>> a testable configuration and keep the review going forward.
>>
>> --
>> Cheers,
>> Carlos.
>>
>
--
Cheers,
Carlos.
More information about the Binutils
mailing list