aboutsummaryrefslogtreecommitdiff
path: root/libexec/rtld-elf/rtld.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2012-01-04 16:43:29 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2012-01-04 16:43:29 +0000
commita7d4832dd55c75963d7803e2979e835e50065a6c (patch)
treeb2448b7fdd9daa2380f97d7d2b37b2a0c1b7ffec /libexec/rtld-elf/rtld.h
parentd5e58e2c676cea1dff8da9d88d4026ff3843e336 (diff)
MFC r228435:
Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to rtld on 386 and amd64. MFC r228503: Postpone the resolution for irelative/ifunc right before initializers are called, and drop bind lock around calls to dispatcher. Use initlist to iterate over the objects instead of the ->next, due to drop of the bind lock in iteration. For i386/reloc.c:reloc_iresolve(), fix calculation of the dispatch function address for dso, by taking into account possible non-zero relocbase. MFC r228635 (by nwhitehorn): Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot() caused the icache to be invalidated at the wrong time, resulting in an icache full of nonsense in the PLT section.
Notes
svn path=/stable/9/; revision=229503
Diffstat (limited to 'libexec/rtld-elf/rtld.h')
-rw-r--r--libexec/rtld-elf/rtld.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h
index 36b4bf67e6a6..4a752e42a285 100644
--- a/libexec/rtld-elf/rtld.h
+++ b/libexec/rtld-elf/rtld.h
@@ -230,6 +230,8 @@ typedef struct Struct_Obj_Entry {
bool on_fini_list: 1; /* Object is already on fini list. */
bool dag_inited : 1; /* Object has its DAG initialized. */
bool filtees_loaded : 1; /* Filtees loaded */
+ bool irelative : 1; /* Object has R_MACHDEP_IRELATIVE relocs */
+ bool gnu_ifunc : 1; /* Object has references to STT_GNU_IFUNC */
struct link_map linkmap; /* For GDB and dlinfo() */
Objlist dldags; /* Object belongs to these dlopened DAGs (%) */
@@ -317,6 +319,7 @@ void lockdflt_init(void);
void obj_free(Obj_Entry *);
Obj_Entry *obj_new(void);
void _rtld_bind_start(void);
+void *rtld_resolve_ifunc(const Obj_Entry *obj, const Elf_Sym *def);
void symlook_init(SymLook *, const char *);
int symlook_obj(SymLook *, const Obj_Entry *);
void *tls_get_addr_common(Elf_Addr** dtvp, int index, size_t offset);
@@ -334,6 +337,8 @@ int do_copy_relocations(Obj_Entry *);
int reloc_non_plt(Obj_Entry *, Obj_Entry *, struct Struct_RtldLockState *);
int reloc_plt(Obj_Entry *);
int reloc_jmpslots(Obj_Entry *, struct Struct_RtldLockState *);
+int reloc_iresolve(Obj_Entry *, struct Struct_RtldLockState *);
+int reloc_gnu_ifunc(Obj_Entry *, struct Struct_RtldLockState *);
void allocate_initial_tls(Obj_Entry *);
#endif /* } */