aboutsummaryrefslogtreecommitdiff
path: root/bfd/arc-got.h
diff options
context:
space:
mode:
authorCupertino Miranda <cmiranda@synopsys.com>2018-08-01 17:22:07 +0100
committerCupertino Miranda <cmiranda@synopsys.com>2018-10-01 12:42:11 +0100
commit0411fca5ec2a6adb96ed768f70ed468435d778ea (patch)
tree2d337e904e57ced7ca021e8740acd3712ee11077 /bfd/arc-got.h
parentab16fcd743b8fc963e736f7d00e3c2f039ce0d56 (diff)
downloadgdb-0411fca5ec2a6adb96ed768f70ed468435d778ea.zip
gdb-0411fca5ec2a6adb96ed768f70ed468435d778ea.tar.gz
gdb-0411fca5ec2a6adb96ed768f70ed468435d778ea.tar.bz2
[ARC] Fixes TLS failures related to tls-align.
This patch fixes glibc testcase in nptl/tls-align. bfd/ 2018-08-01 Cupertino Miranda <cmiranda@synopsys.com> * arc-got.h (relocate_fix_got_relocs_for_got_info): Changed, fixed TCB_SIZE offsize to include section alignment. * elf32-arc.c (arc_special_overflow_checks): Likewise. include/ 2018-08-01 Cupertino Miranda <cmiranda@synopsys.com> * arc-reloc.def (ARC_TLS_LE_32): Updated reloc formula.
Diffstat (limited to 'bfd/arc-got.h')
-rw-r--r--bfd/arc-got.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/arc-got.h b/bfd/arc-got.h
index 81ce88f..e32d9b3 100644
--- a/bfd/arc-got.h
+++ b/bfd/arc-got.h
@@ -24,6 +24,9 @@
#define TCB_SIZE (8)
+#define align_power(addr, align) \
+ (((addr) + ((bfd_vma) 1 << (align)) - 1) & (-((bfd_vma) 1 << (align))))
+
enum tls_type_e
{
GOT_UNKNOWN = 0,
@@ -359,7 +362,10 @@ relocate_fix_got_relocs_for_got_info (struct got_entry ** list_p,
bfd_put_32 (output_bfd,
sym_value - sec_vma
- + (elf_hash_table (info)->dynamic_sections_created ? 0 : TCB_SIZE),
+ + (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));