diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-elf/arm/reloc.c | 13 | ||||
-rw-r--r-- | libexec/rtld-elf/arm/rtld_machdep.h | 23 | ||||
-rw-r--r-- | libexec/rtld-elf/arm/rtld_start.S | 9 | ||||
-rw-r--r-- | libexec/rtld-elf/rtld.c | 3 |
4 files changed, 32 insertions, 16 deletions
diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index e4157b6..6dd8ad0 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -90,13 +90,11 @@ _rtld_relocate_nonplt_self(Elf_Dyn *dynp, Elf_Addr relocbase) } rellim = (const Elf_Rel *)((caddr_t)rel + relsz); size = (rellim - 1)->r_offset - rel->r_offset; - mprotect((void*)relocbase, size, PROT_READ|PROT_WRITE|PROT_EXEC); for (; rel < rellim; rel++) { where = (Elf_Addr *)(relocbase + rel->r_offset); *where += (Elf_Addr)relocbase; } - mprotect((void*)relocbase, size, PROT_READ|PROT_EXEC); } /* * It is possible for the compiler to emit relocations for unaligned data. @@ -339,3 +337,14 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const Obj_Entry *defobj, return target; } +void +allocate_initial_tls(Obj_Entry *objs) +{ + +} + +void * +__tls_get_addr(tls_index* ti) +{ + return (NULL); +} diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h index 02849a9..8e841e0 100644 --- a/libexec/rtld-elf/arm/rtld_machdep.h +++ b/libexec/rtld-elf/arm/rtld_machdep.h @@ -37,14 +37,8 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ -#if 0 -#define rtld_dynamic(obj) \ - ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) -#endif -#if 0 #define rtld_dynamic(obj) (&_DYNAMIC) -#endif -#define rtld_dynamic(obj) (const Elf_Dyn *)((obj)->relocbase) + Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, const struct Struct_Obj_Entry *obj, @@ -55,10 +49,25 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) + +typedef struct { + unsigned long ti_module; + unsigned long ti_offset; +} tls_index; +#define round(size, align) \ + (((size) + (align) - 1) & ~((align) - 1)) +#define calculate_first_tls_offset(size, align) \ + round(size, align) +#define calculate_tls_offset(prev_offset, prev_size, size, align) \ + round(prev_offset + prev_size, align) +#define calculate_tls_end(off, size) ((off) + (size)) + + /* * Lazy binding entry point, called via PLT. */ void _rtld_bind_start(void); +extern void *__tls_get_addr(tls_index *ti); #endif diff --git a/libexec/rtld-elf/arm/rtld_start.S b/libexec/rtld-elf/arm/rtld_start.S index 5b0619b..1789791 100644 --- a/libexec/rtld-elf/arm/rtld_start.S +++ b/libexec/rtld-elf/arm/rtld_start.S @@ -60,17 +60,14 @@ __FBSDID("$FreeBSD$"); bl _rtld_relocate_nonplt_self mov r1, sp add r2, sp, #4 - mov r0, r6 /* sp */ + mov r0, r6 /* sp */ bl _rtld /* call the shared loader */ mov r3, r0 /* save entry point */ - ldr r1, [sp, #0] /* r2 = cleanup */ - ldr r0, [sp, #4] /* r1 = obj_main */ + ldr r2, [sp, #0] /* r2 = cleanup */ + ldr r1, [sp, #4] /* r1 = obj_main */ add sp, sp, #8 /* restore stack */ - #if 0 mov r0, r4 /* restore ps_strings */ - #endif - mov r2, #0 mov pc, r3 /* jump to the entry point */ .L2: .word _GLOBAL_OFFSET_TABLE_ - (.L1+8) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 3891f17..5740e91 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -2607,7 +2607,8 @@ free_tls(void *tls, size_t tcbsize, size_t tcbalign) #endif -#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) +#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ + defined(__arm__) /* * Allocate Static TLS using the Variant II method. |