Changeset d3e938c in mainline
- Timestamp:
- 2019-01-08T13:27:05Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 05cb995, 1567471, 1aa9eff, cdec2a1
- Parents:
- 9c4df21
- git-author:
- Jiri Svoboda <jiri@…> (2018-01-07 22:27:02)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-01-08 13:27:05)
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/asmtool.h
r9c4df21 rd3e938c 56 56 SYMBOL_END(func) 57 57 58 #ifdef __PIC__ 59 #define FUNCTION_REF(func) func@PLT 60 #else 61 #define FUNCTION_REF(func) func 62 #endif 63 58 64 #endif 59 65 -
uspace/lib/c/arch/amd64/Makefile.inc
r9c4df21 rd3e938c 34 34 arch/$(UARCH)/src/tls.c \ 35 35 arch/$(UARCH)/src/stacktrace.c \ 36 arch/$(UARCH)/src/stacktrace_asm.S 36 arch/$(UARCH)/src/stacktrace_asm.S \ 37 arch/$(UARCH)/src/rtld/dynamic.c \ 38 arch/$(UARCH)/src/rtld/reloc.c 37 39 38 40 ARCH_AUTOCHECK_HEADERS = \ -
uspace/lib/c/arch/amd64/include/libarch/tls.h
r9c4df21 rd3e938c 45 45 void *self; 46 46 void *fibril_data; 47 void **dtv; 48 void *pad; 47 49 } tcb_t; 48 50 -
uspace/lib/c/arch/amd64/src/entry.S
r9c4df21 rd3e938c 47 47 # %rdi was deliberately chosen as the first argument is also in %rdi 48 48 # Pass PCB pointer to __c_start (no operation) 49 call __c_start49 call FUNCTION_REF(__c_start) -
uspace/lib/c/arch/amd64/src/thread_entry.S
r9c4df21 rd3e938c 46 46 # 47 47 movq %rax, %rdi 48 call __thread_main48 call FUNCTION_REF(__thread_main) 49 49 SYMBOL_END(__thread_entry) -
uspace/lib/c/arch/amd64/src/tls.c
r9c4df21 rd3e938c 38 38 #include <stddef.h> 39 39 40 #ifdef CONFIG_RTLD 41 #include <rtld/rtld.h> 42 #endif 43 40 44 tcb_t *tls_alloc_arch(size_t size, size_t align) 41 45 { … … 48 52 } 49 53 54 /* 55 * Rtld TLS support 56 */ 57 58 typedef struct { 59 unsigned long int ti_module; 60 unsigned long int ti_offset; 61 } tls_index; 62 63 void __attribute__((__regparm__(1))) 64 *__tls_get_addr(tls_index *ti); 65 66 void __attribute__((__regparm__(1))) 67 *__tls_get_addr(tls_index *ti) 68 { 69 uint8_t *tls; 70 71 #ifdef CONFIG_RTLD 72 if (runtime_env != NULL) { 73 return rtld_tls_get_addr(runtime_env, __tcb_get(), 74 ti->ti_module, ti->ti_offset); 75 } 76 #endif 77 /* Get address of static TLS block */ 78 tls = tls_get(); 79 return tls + ti->ti_offset; 80 } 81 50 82 /** @} 51 83 */ -
uspace/lib/c/generic/rtld/dynamic.c
r9c4df21 rd3e938c 64 64 d_ptr = (void *)((uint8_t *)dp->d_un.d_ptr + bias); 65 65 d_val = dp->d_un.d_val; 66 DPRINTF("tag=%u ptr=0x% x val=%u\n", (unsigned)dp->d_tag,67 (u nsigned)d_ptr, (unsigned)d_val);66 DPRINTF("tag=%u ptr=0x%zx val=%zu\n", (unsigned)dp->d_tag, 67 (uintptr_t)d_ptr, (uintptr_t)d_val); 68 68 69 69 switch (dp->d_tag) { -
uspace/lib/c/include/rtld/elf_dyn.h
r9c4df21 rd3e938c 39 39 #include <libarch/rtld/elf_dyn.h> 40 40 41 #define ELF32_R_SYM(i) ((i) >>8)41 #define ELF32_R_SYM(i) ((i) >> 8) 42 42 #define ELF32_R_TYPE(i) ((unsigned char)(i)) 43 44 #define ELF64_R_SYM(i) ((i) >> 32) 45 #define ELF64_R_TYPE(i) ((i) & 0xffffffffL) 43 46 44 47 struct elf32_dyn { … … 47 50 elf_word d_val; 48 51 elf32_addr d_ptr; 52 } d_un; 53 }; 54 55 struct elf64_dyn { 56 elf_sxword d_tag; 57 union { 58 elf_xword d_val; 59 elf64_addr d_ptr; 49 60 } d_un; 50 61 }; … … 61 72 }; 62 73 74 struct elf64_rel { 75 elf64_addr r_offset; 76 elf_xword r_info; 77 }; 78 79 struct elf64_rela { 80 elf64_addr r_offset; 81 elf_xword r_info; 82 elf_sxword r_addend; 83 }; 84 63 85 #ifdef __32_BITS__ 64 86 typedef struct elf32_dyn elf_dyn_t; 65 87 typedef struct elf32_rel elf_rel_t; 66 88 typedef struct elf32_rela elf_rela_t; 89 #endif 90 91 #ifdef __64_BITS__ 92 typedef struct elf64_dyn elf_dyn_t; 93 typedef struct elf64_rel elf_rel_t; 94 typedef struct elf64_rela elf_rela_t; 67 95 #endif 68 96
Note:
See TracChangeset
for help on using the changeset viewer.