This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposal for STT_GNU_IFUNC and R_*_IRELATIVE


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

H.J. Lu wrote:
> 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?

In this specific case, fail on anything but the R_*_IRELATIVE
relocation.  Should there be in future another relocation which has to
be handled even in static executables then it'll get it's own 'else if'
branch.  You don't have to copy into the static executable any
relocation except those really needed.

- --
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoenjsACgkQ2ijCOnn/RHT1bgCgtflclvCisZ2PxG9qAEPRDGS7
oaAAnRaPILPvOI/x48vA8h6VekTgn1p0
=+bet
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]