This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Proposal for STT_GNU_IFUNC and R_*_IRELATIVE
> Alan Modra wrote:
>> Is it true that the new IRELATIVE relocation should only appear in
>> .plt, and the .plt entries involved are all the size size? ?If so, ld
>> can ensure that all such .plt entries are adjacent and emit two new
>> tags giving the array location and size.
>
> Once again with the special handling. ?This isn't faster.
>
> Aside from that, unknown DT_* flags are no fatal errors at program
> loading time. ?Unknown relocations are. ?The result is that with your
> proposal people running new binaries on old systems will see mysterious
> crashes or worse, strange results. ?With new relocations they will see a
> useful error message and predictable behavior.
>
Good point. I have
static inline void
__attribute ((always_inline))
elf_machine_irela (const Elf64_Rela *reloc)
{
Elf64_Addr *const reloc_addr = (void *) reloc->r_offset;
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 1))
{
Elf64_Addr value = reloc->r_addend;
value = ((Elf64_Addr (*) (void)) value) ();
*reloc_addr = value;
}
}
for static executables. It is called from elf-init.c. How can I
report a bad relocation safetly?
--
H.J.