Relocations reference local (static or hidden) symbols on ia64
Florian Weimer
fweimer@redhat.com
Thu Sep 23 21:31:22 GMT 2021
* Fangrui Song:
> On 2021-09-23, Florian Weimer via Binutils wrote:
>>I am trying to get rid of relocations with symbols in ld.so in glibc.
>>It will simplify self-relocation of the dynamic loader *a lot*. (The
>>amount of cruft that goes away with this change is utterly ridiculous.)
>
> Like musl ldso/dystart.c which only processes relative relocations?
Something like that, right.
> If you remove symbol lookup code for self-relocation ld.so, it may
> prevent a possible future direction combining libc.so into ld.so (like musl)
> for glibc 3.0 :) But perhaps this is desired.
I think merging libc.so into ld.so is rather far out for us. We would
have to figure out something for the separate libc.so in audit
namespaces, and there are many other issues.
> Can you describe a bit how glibc self-relocation can be simplified?
You said it, handle relative relocations only (and not even IRELATIVE).
And add a built-time check that we only get such relocation types.
It's considerably simpler than handling static PIE, so it can be
implemented easily enough for !PI_STATIC_AND_HIDDEN targets, too.
I looked at this in the context of nested function removal, but your
latest patch suggests to me that we don't actually need it for that.
Thanks,
Florian
More information about the Binutils
mailing list