summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/amd64
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/rtld-elf/amd64')
-rw-r--r--libexec/rtld-elf/amd64/reloc.c14
-rw-r--r--libexec/rtld-elf/amd64/rtld_machdep.h18
2 files changed, 18 insertions, 14 deletions
diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c
index 10b9332..47d9522 100644
--- a/libexec/rtld-elf/amd64/reloc.c
+++ b/libexec/rtld-elf/amd64/reloc.c
@@ -387,6 +387,20 @@ reloc_jmpslots(Obj_Entry *obj, int flags, RtldLockState *lockstate)
return 0;
}
+/* Fixup the jump slot at "where" to transfer control to "target". */
+Elf_Addr
+reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
+ const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj,
+ const Elf_Rel *rel)
+{
+#ifdef dbg
+ dbg("reloc_jmpslot: *%p = %p", where, (void *)target);
+#endif
+ if (!ld_bind_not)
+ *where = target;
+ return (target);
+}
+
int
reloc_iresolve(Obj_Entry *obj, RtldLockState *lockstate)
{
diff --git a/libexec/rtld-elf/amd64/rtld_machdep.h b/libexec/rtld-elf/amd64/rtld_machdep.h
index 0a6354f..df1aff6 100644
--- a/libexec/rtld-elf/amd64/rtld_machdep.h
+++ b/libexec/rtld-elf/amd64/rtld_machdep.h
@@ -38,21 +38,11 @@ struct Struct_Obj_Entry;
Elf_Dyn *rtld_dynamic_addr(void);
#define rtld_dynamic(obj) rtld_dynamic_addr()
-/* Fixup the jump slot at "where" to transfer control to "target". */
-static inline Elf_Addr
-reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
- const struct Struct_Obj_Entry *obj,
- const struct Struct_Obj_Entry *refobj, const Elf_Rel *rel)
-{
-#ifdef dbg
- dbg("reloc_jmpslot: *%p = %p", (void *)(where),
- (void *)(target));
-#endif
- (*(Elf_Addr *)(where) = (Elf_Addr)(target));
- return target;
-}
+Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
+ const struct Struct_Obj_Entry *obj, const struct Struct_Obj_Entry *refobj,
+ const Elf_Rel *rel);
-#define make_function_pointer(def, defobj) \
+#define make_function_pointer(def, defobj) \
((defobj)->relocbase + (def)->st_value)
#define call_initfini_pointer(obj, target) \
OpenPOWER on IntegriCloud