diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 9 | ||||
-rw-r--r-- | bfd/arc-got.h | 8 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 3 |
3 files changed, 18 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 14e4107326c..b26e53135cb 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,6 +1,15 @@ 2018-11-15 Claudiu Zissulescu <claziss@synopsys.com> Backport from mainline + 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. + + +2018-11-15 Claudiu Zissulescu <claziss@synopsys.com> + + Backport from mainline 2018-03-02 Cupertino Miranda <cmiranda@synopsys.com> * elf32-arc.c (elf_arc_check_relocs): Changed. diff --git a/bfd/arc-got.h b/bfd/arc-got.h index 81ce88fe21a..e32d9b30e31 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)); diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 052765ebdb8..d11b773adc5 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1202,7 +1202,8 @@ arc_special_overflow_checks (const struct arc_relocation_data reloc_data, #define _SDA_BASE_ (bfd_signed_vma) (reloc_data.sdata_begin_symbol_vma) #define TLS_REL (bfd_signed_vma) \ ((elf_hash_table (info))->tls_sec->output_section->vma) -#define TLS_TBSS (8) +#define TLS_TBSS (align_power(TCB_SIZE, \ + reloc_data.sym_section->alignment_power)) #define none (0) |