diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-02-29 16:51:11 +0100 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-02-29 16:51:11 +0100 |
commit | 841fdfcdd9caa69f3ad7560a2806d421e23f598a (patch) | |
tree | 4ea424595cbcb8ffc938e0ba6fbbbb63f90cfa24 /bfd | |
parent | 7e4588997ebdddefc48d8be2d51a715822817c0e (diff) | |
download | gdb-841fdfcdd9caa69f3ad7560a2806d421e23f598a.zip gdb-841fdfcdd9caa69f3ad7560a2806d421e23f598a.tar.gz gdb-841fdfcdd9caa69f3ad7560a2806d421e23f598a.tar.bz2 |
[ARC] Local symbols relocation cleanup
bfd/
2016-02-29 Cupertino Miranda <cmiranda@synopsys.com>
* elf32-arc.c (elf_arc_relocate_section): Added rules to fix the
relocation addend when sections get merged.
gas/
2016-02-29 Cupertino Miranda <cmiranda@synopsys.com>
Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
* config/tc-arc.c (arc_extra_reloc): Change size to 0.
(tc_arc_fix_adjustable): Changed default return value to 1.
* testsuite/gas/arc/j.d: Updated expected symbol
* testsuite/gas/arc/jl.d: Likewise
* testsuite/gas/arc/relax-avoid1.d: Likewise
* testsuite/gas/arc/st.d: Likewise
ld/
2016-02-29 Cupertino Miranda <cmiranda@synopsys.com>
* testsuite/ld-elf/merge.d: Removed xfail for ARC.
* testsuite/ld-elf/merge2.d: Likewise.
* testsuite/ld-elf/merge3.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-arc.c | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5d39624..5561f4b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-02-29 Cupertino Miranda <cmiranda@synopsys.com> + + * elf32-arc.c (elf_arc_relocate_section): Added rules to fix the + relocation addend when sections get merged. + 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com> * elf32-arc.c (arc_elf_final_write_processing): Add condition to diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 9993478..ab2512d 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -1158,6 +1158,22 @@ elf_arc_relocate_section (bfd * output_bfd, reloc_data.sym_value = sym->st_value; reloc_data.sym_section = sec; + /* Mergeable section handling. */ + if ((sec->flags & SEC_MERGE) + && ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + asection *msec; + msec = sec; + rel->r_addend = _bfd_elf_rel_local_sym (output_bfd, sym, + &msec, rel->r_addend); + rel->r_addend -= (sec->output_section->vma + + sec->output_offset + + sym->st_value); + rel->r_addend += msec->output_section->vma + msec->output_offset; + + reloc_data.reloc_addend = rel->r_addend; + } + if ((is_reloc_for_GOT (howto) || is_reloc_for_TLS (howto)) && entry != NULL) { |