aboutsummaryrefslogtreecommitdiff
path: root/bfd/arc-got.h
diff options
context:
space:
mode:
authorCupertino Miranda <cmiranda@synopsys.com>2018-09-06 00:50:35 +0100
committerCupertino Miranda <cmiranda@synopsys.com>2018-10-01 12:42:11 +0100
commit714e9a954a2e4123dcb26bb8da850e1344de4f5f (patch)
tree8b2bef98b70f26840a402854fb6c20589229a3e0 /bfd/arc-got.h
parent0411fca5ec2a6adb96ed768f70ed468435d778ea (diff)
downloadgdb-714e9a954a2e4123dcb26bb8da850e1344de4f5f.zip
gdb-714e9a954a2e4123dcb26bb8da850e1344de4f5f.tar.gz
gdb-714e9a954a2e4123dcb26bb8da850e1344de4f5f.tar.bz2
[ARC] Fixed issue with DTSOFF relocs.
Inserted offset in final section in the GOT entry of type DTSOFF soon to be relocated by the dynamic loader. bfd/ 2018-09-06 Cupertino Miranda <cmiranda@synopsys.com> * arc-got.h (relocate_fix_got_relocs_for_got_info): Changed. Take TLS section alignment in consideration for this relocation. * elf32-arc.c (FINAL_SECTSTART): Added this formula macro. (ARC_TLS_DTPOFF) Updated reloc to use new created macro instead.
Diffstat (limited to 'bfd/arc-got.h')
-rw-r--r--bfd/arc-got.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/bfd/arc-got.h b/bfd/arc-got.h
index e32d9b3..07722fd 100644
--- a/bfd/arc-got.h
+++ b/bfd/arc-got.h
@@ -335,7 +335,11 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
bfd_vma sec_vma = tls_sec->output_section->vma;
bfd_put_32 (output_bfd,
- sym_value - sec_vma,
+ sym_value - sec_vma
+ + (elf_hash_table (info)->dynamic_sections_created
+ ? 0
+ : (align_power (TCB_SIZE,
+ tls_sec->alignment_power))),
htab->sgot->contents + entry->offset
+ (entry->existing_entries == TLS_GOT_MOD_AND_OFF
? 4 : 0));
@@ -346,7 +350,7 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
"GOT_TLS_IE"),
(long) (sym_value - sec_vma),
(long) (htab->sgot->output_section->vma
- + htab->sgot->output_offset->vma
+ + htab->sgot->output_offset
+ entry->offset
+ (entry->existing_entries == TLS_GOT_MOD_AND_OFF
? 4 : 0)),
@@ -376,7 +380,7 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
"GOT_TLS_IE"),
(long) (sym_value - sec_vma),
(long) (htab->sgot->output_section->vma
- + htab->sgot->output_offset->vma
+ + htab->sgot->output_offset
+ entry->offset
+ (entry->existing_entries == TLS_GOT_MOD_AND_OFF
? 4 : 0)),