[PATCH v2] elf: Support DT_RELR relative relocation format [BZ #27924]

H.J. Lu hjl.tools@gmail.com
Mon Oct 18 19:45:42 GMT 2021


On Mon, Oct 18, 2021 at 12:22 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> On Mon, 18 Oct 2021, H.J. Lu via Binutils wrote:
>
> > For Linux targets, we need the glibc version dependency for
> > DT_RELR support at run-time.
>
> What we've supposedly previously done with new ELF features is use
> EI_ABIVERSION (see libc-abis in glibc).
>
> That requires the static linker to compute the right ABI version based on
> which of the relevant features is used by the generated binary (note that
> the ordering of different features, and thus the numbers assigned to them
> as well as which of them counts as the newest feature to be stored in
> EI_ABIVERSION, is *not* the same across glibc architectures).  I'm not
> sure the binutils side of things was ever implemented on most
> architectures, or that the checks in glibc get properly applied to all
> relevant ELF objects (dynamic linker, main program, loaded shared
> libraries), but in principle the mechanism exists and avoids the linker
> needing to know about specific glibc version numbers itself (at the
> expense of needing to know the per-architecture version numbers and
> ordering for different ELF features).
>

We may use it if the existing ld.so implements the check.

-- 
H.J.


More information about the Binutils mailing list