summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2017-04-14 07:07:57 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2017-05-14 10:29:09 +0200
commitbaad294eaf59e0e1b311a11448a04e3d3c5f3c56 (patch)
tree858d8924af34509f8742d025c6d8740f20464a97 /ldso
parent69ea4c1f65bff99575cd7f0210312dc355929240 (diff)
or1k: add NPTL/TLS support
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/or1k/elfinterp.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/ldso/ldso/or1k/elfinterp.c b/ldso/ldso/or1k/elfinterp.c
index 41db368b3..08668172c 100644
--- a/ldso/ldso/or1k/elfinterp.c
+++ b/ldso/ldso/or1k/elfinterp.c
@@ -212,7 +212,6 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
switch (reloc_type) {
case R_OR1K_NONE:
break;
-
case R_OR1K_8:
case R_OR1K_16:
case R_OR1K_32:
@@ -220,23 +219,19 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
((struct unaligned *)reloc_addr)->x = symbol_addr +
rpnt->r_addend;
break;
-
case R_OR1K_8_PCREL:
case R_OR1K_16_PCREL:
case R_OR1K_32_PCREL:
case R_OR1K_INSN_REL_26:
*reloc_addr = symbol_addr + rpnt->r_addend;
break;
-
case R_OR1K_GLOB_DAT:
case R_OR1K_JMP_SLOT:
*reloc_addr = symbol_addr + rpnt->r_addend;
break;
-/* Handled by elf_machine_relative */
case R_OR1K_RELATIVE:
*reloc_addr = (unsigned long)tpnt->loadaddr + rpnt->r_addend;
break;
-
case R_OR1K_COPY:
if (symbol_addr) {
#if defined (__SUPPORT_LD_DEBUG__)
@@ -256,6 +251,18 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope,
_dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n");
#endif
break;
+#if defined USE_TLS && USE_TLS
+ case R_OR1K_TLS_DTPMOD:
+ *reloc_addr = tls_tpnt->l_tls_modid;
+ break;
+ case R_OR1K_TLS_DTPOFF:
+ *reloc_addr = symbol_addr;
+ break;
+ case R_OR1K_TLS_TPOFF:
+ CHECK_STATIC_TLS ((struct link_map *) tls_tpnt);
+ *reloc_addr = tls_tpnt->l_tls_offset + symbol_addr + rpnt->r_addend;
+ break;
+#endif
default:
return -1; /* Calls _dl_exit(1). */