diff options
author | Ulrich Drepper <drepper@redhat.com> | 2009-05-31 23:45:33 -0700 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2009-05-31 23:45:33 -0700 |
commit | 74414708355a922a514d5c76183eca6931c4488a (patch) | |
tree | 60dd084df2e9f02464f66b0da2068f4561856458 /csu | |
parent | 963cb6fcb47ca212c0c57cc57bd7510f6549579c (diff) | |
download | glibc-74414708355a922a514d5c76183eca6931c4488a.tar.gz glibc-74414708355a922a514d5c76183eca6931c4488a.tar.xz glibc-74414708355a922a514d5c76183eca6931c4488a.zip |
Finish IFUNC support for x86 and x86-64.
Add support for the IRELAIVE relocation and IFUNC in static executables.
Diffstat (limited to 'csu')
-rw-r--r-- | csu/elf-init.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/csu/elf-init.c b/csu/elf-init.c index 27eae1550b..5a99a3a400 100644 --- a/csu/elf-init.c +++ b/csu/elf-init.c @@ -36,6 +36,20 @@ #include <stddef.h> +#ifndef LIBC_NONSHARED +# include <link.h> +# include <dl-irel.h> + +# ifdef ELF_MACHINE_IRELA +extern const ElfW(Rela) __rela_iplt_start []; +extern const ElfW(Rela) __rela_iplt_end []; +# endif + +# ifdef ELF_MACHINE_IREL +extern const ElfW(Rel) __rel_iplt_start []; +extern const ElfW(Rel) __rel_iplt_end []; +# endif +#endif /* LIBC_NONSHARED */ /* These magic symbols are provided by the linker. */ extern void (*__preinit_array_start []) (int, char **, char **) @@ -67,6 +81,22 @@ __libc_csu_init (int argc, char **argv, char **envp) the dynamic linker (before initializing any shared object. */ #ifndef LIBC_NONSHARED +# ifdef ELF_MACHINE_IRELA + { + const size_t size = __rela_iplt_end - __rela_iplt_start; + for (size_t i = 0; i < size; i++) + elf_irela (&__rela_iplt_start [i]); + } +# endif + +# ifdef ELF_MACHINE_IREL + { + const size_t size = __rel_iplt_end - __rel_iplt_start; + for (size_t i = 0; i < size; i++) + elf_irel (&__rel_iplt_start [i]); + } +# endif + /* For static executables, preinit happens rights before init. */ { const size_t size = __preinit_array_end - __preinit_array_start; |