Relocations reference local (static or hidden) symbols on ia64

Fangrui Song i@maskray.me
Thu Sep 23 21:12:59 GMT 2021


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?

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.

Can you describe a bit how glibc self-relocation can be simplified?

>Consider my surprise when I learnt that ia64 ld produces symbolic
>relocations for static functions in some cases, for example this:
>
>Relocation section '.rela.dyn' at offset 0xeb8 contains 53 entries:
>    Offset             Info             Type               Symbol's Value  Symbol's Name + Addend
>[…]
>0000000000061608  0000001800000047 R_IA64_FPTR64LSB       000000000001dc00 openaux + 0
>[…]
>
>Against:
>
>Symbol table '.dynsym' contains 65 entries:
>   Num:    Value          Size Type    Bind   Vis      Ndx Name
>[…]
>    24: 000000000001dc00   176 FUNC    LOCAL  DEFAULT   10 openaux
>[…]
>
>Is this just a fancy way of using the value 0x1dc00 in the relocation?
>I have attached an object like this.
>
>Are there any other targets I should watch out for if I want to avoid
>fancy relocations?

For riscv,
-shared -Bsymbolic uses JUMP_SLOT instead of IRELATIVE: https://sourceware.org/bugzilla/show_bug.cgi?id=27153

>(ld.so in glibc does not use thread local storage and should otherwise
>be very harmless.  On most targets, there will be exactly one relocation
>type to process.  Even hppa has just 3.)
>
>Thanks,
>Florian




More information about the Binutils mailing list