summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/i386
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2001-10-15 18:48:42 +0000
committerdfr <dfr@FreeBSD.org>2001-10-15 18:48:42 +0000
commit7d69aa453630c63bba640d287d0781db518b5a53 (patch)
tree58745c0bcc233d2e6a7a5aae303d27432c4dd053 /libexec/rtld-elf/i386
parent8d45c0568791bbcc1147afa6e857e7b307c43c11 (diff)
downloadFreeBSD-src-7d69aa453630c63bba640d287d0781db518b5a53.zip
FreeBSD-src-7d69aa453630c63bba640d287d0781db518b5a53.tar.gz
Add ia64 support. Various adjustments were made to existing targets to
cope with a few interface changes required by the ia64. In particular, function pointers on ia64 need special treatment in rtld.
Diffstat (limited to 'libexec/rtld-elf/i386')
-rw-r--r--libexec/rtld-elf/i386/reloc.c5
-rw-r--r--libexec/rtld-elf/i386/rtld_machdep.h20
2 files changed, 17 insertions, 8 deletions
diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c
index aff70b0..3954452 100644
--- a/libexec/rtld-elf/i386/reloc.c
+++ b/libexec/rtld-elf/i386/reloc.c
@@ -237,7 +237,7 @@ reloc_jmpslots(Obj_Entry *obj)
return 0;
rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize);
for (rel = obj->pltrel; rel < rellim; rel++) {
- Elf_Addr *where;
+ Elf_Addr *where, target;
const Elf_Sym *def;
const Obj_Entry *defobj;
@@ -246,7 +246,8 @@ reloc_jmpslots(Obj_Entry *obj)
def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL);
if (def == NULL)
return -1;
- reloc_jmpslot(where, (Elf_Addr)(defobj->relocbase + def->st_value));
+ target = (Elf_Addr)(defobj->relocbase + def->st_value);
+ reloc_jmpslot(where, target, defobj);
}
obj->jmpslots_done = true;
return 0;
diff --git a/libexec/rtld-elf/i386/rtld_machdep.h b/libexec/rtld-elf/i386/rtld_machdep.h
index 37a81d3..a26394f 100644
--- a/libexec/rtld-elf/i386/rtld_machdep.h
+++ b/libexec/rtld-elf/i386/rtld_machdep.h
@@ -29,17 +29,25 @@
#ifndef RTLD_MACHDEP_H
#define RTLD_MACHDEP_H 1
+struct Struct_Obj_Entry;
+
/* Return the address of the .dynamic section in the dynamic linker. */
#define rtld_dynamic(obj) \
((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC))
/* Fixup the jump slot at "where" to transfer control to "target". */
-#define reloc_jmpslot(where, target) \
- do { \
- dbg("reloc_jmpslot: *%p = %p", (void *)(where), \
- (void *)(target)); \
- (*(Elf_Addr *)(where) = (Elf_Addr)(target)); \
- } while (0)
+static inline Elf_Addr
+reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
+ const struct Struct_Obj_Entry *obj)
+{
+ dbg("reloc_jmpslot: *%p = %p", (void *)(where),
+ (void *)(target));
+ (*(Elf_Addr *)(where) = (Elf_Addr)(target));
+ return target;
+}
+
+#define make_function_pointer(def, defobj) \
+ ((defobj)->relocbase + (def)->st_value)
static inline void
atomic_decr_int(volatile int *p)
OpenPOWER on IntegriCloud