This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/5] Content for TLS_IE_GOT not written to .got.
- From: Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- To: binutils at sourceware dot org
- Cc: Francois dot Bedard at synopsys dot com, Claudiu dot Zissulescu at synopsys dot com, Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- Date: Tue, 16 Aug 2016 17:51:13 +0200
- Subject: [PATCH 2/5] Content for TLS_IE_GOT not written to .got.
- Authentication-results: sourceware.org; auth=none
- References: <20160816155116.23937-1-cmiranda@synopsys.com>
When no dynamic relocation was generated the .got content would not be
updated for the TLS_IE_GOT relocation addresses.
bfd/ChangeLog:
Cupertino Miranda <cmiranda@synopsys.com>
arc-got.h (relocate_fix_got_relocs_for_got_info): Fixed addresses in
debug comments. Fixed address in .got related to TLS_IE_GOT dynamic
relocation.
---
bfd/arc-got.h | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/bfd/arc-got.h b/bfd/arc-got.h
index 7c3cfd9..9ac0295 100644
--- a/bfd/arc-got.h
+++ b/bfd/arc-got.h
@@ -334,13 +334,15 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
? 4 : 0));
ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx "
- "@ %p, for symbol %s\n",
+ "@ %lx, for symbol %s\n",
(entry->type == GOT_TLS_GD ? "GOT_TLS_GD" :
"GOT_TLS_IE"),
(long) (sym_value - sec_vma),
- htab->sgot->contents + entry->offset
- + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
- ? 4 : 0),
+ (long) (htab->sgot->output_section->vma
+ + htab->sgot->output_offset->vma
+ + entry->offset
+ + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+ ? 4 : 0)),
symbol_name);
}
break;
@@ -351,14 +353,22 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
bfd_vma ATTRIBUTE_UNUSED sec_vma
= tls_sec->output_section->vma;
+ bfd_put_32 (output_bfd,
+ sym_value - sec_vma,
+ htab->sgot->contents + entry->offset
+ + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+ ? 4 : 0));
+
ARC_DEBUG ("arc_info: FIXED -> %s value = %#lx "
"@ %p, for symbol %s\n",
(entry->type == GOT_TLS_GD ? "GOT_TLS_GD" :
"GOT_TLS_IE"),
(long) (sym_value - sec_vma),
- htab->sgot->contents + entry->offset
- + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
- ? 4 : 0),
+ (long) (htab->sgot->output_section->vma
+ + htab->sgot->output_offset->vma
+ + entry->offset
+ + (entry->existing_entries == TLS_GOT_MOD_AND_OFF
+ ? 4 : 0)),
symbol_name);
}
break;
--
2.9.0