diff options
author | Cupertino Miranda <cmiranda@synopsys.com> | 2015-10-28 13:48:00 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-10-28 13:48:00 +0000 |
commit | 6f4b1afcdc8317280669d020765b8215110c4584 (patch) | |
tree | b6365ff26a33f93899421909914d54c7e69e7721 /bfd/elf32-arc.c | |
parent | 7963511fbf0459fff586c3129705bfbc706770e3 (diff) | |
download | gdb-6f4b1afcdc8317280669d020765b8215110c4584.zip gdb-6f4b1afcdc8317280669d020765b8215110c4584.tar.gz gdb-6f4b1afcdc8317280669d020765b8215110c4584.tar.bz2 |
Fix errors in the gas testsuite for the ARC target.
bfd * reloc.c (BFD_RELOC_ARC_32_PCREL): New entry.
(ARC_TLS_DTPOFF): Arrange it in order.
* elf32-arc.c (arc_elf_howto_ini): Update formula.
(get_middle_endian_relocation): New function.
(PDATA): Define.
* bfd-in2.h: Regenerate.
* libbfd.h: Likewise.
elf * arc-reloc.def (ARC_32_PCREL): New definition.
gas * config/tc-arc.c (tokenize_arguments): Avoid creating unused
symbols when parsing relocation types.
(md_apply_fix): Handle TLS relocations. Fix BFD_RELOC_ARC_32_PCREL
relocation.
(arc_check_reloc): Emit BFD_RELOC_ARC_32_PCREL relocation.
Diffstat (limited to 'bfd/elf32-arc.c')
-rw-r--r-- | bfd/elf32-arc.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c index 68a47ca..37a426c 100644 --- a/bfd/elf32-arc.c +++ b/bfd/elf32-arc.c @@ -229,7 +229,8 @@ static struct reloc_howto_struct elf_arc_howto_table[] = static void arc_elf_howto_init (void) { #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ - elf_arc_howto_table[TYPE].pc_relative = (strstr (#FORMULA, " P ") != NULL); + elf_arc_howto_table[TYPE].pc_relative = \ + (strstr (#FORMULA, " P ") != NULL || strstr (#FORMULA, " PDATA ") != NULL); #include "elf/arc-reloc.def" } @@ -473,6 +474,17 @@ debug_arc_reloc (struct arc_relocation_data reloc_data) fprintf (stderr, " input section is NULL\n"); } +static ATTRIBUTE_UNUSED bfd_vma +get_middle_endian_relocation (bfd_vma reloc) +{ + bfd_vma ret = + ((reloc & 0xffff0000) >> 16) | + ((reloc & 0xffff) << 16); + return ret; +} + +#define ME(RELOC) (get_middle_endian_reloction(RELOC)) + #define S (reloc_data.sym_value \ + reloc_data.sym_section->output_offset \ + reloc_data.sym_section->output_section->vma) @@ -491,6 +503,11 @@ debug_arc_reloc (struct arc_relocation_data reloc_data) + reloc_data.input_section->output_offset \ + (reloc_data.reloc_offset - (bitsize >= 32 ? 4 : 0)) \ ) & ~0x3) +#define PDATA ( \ + (reloc_data.input_section->output_section->vma \ + + reloc_data.input_section->output_offset \ + + (reloc_data.reloc_offset) \ + ) & ~0x3) #define SECTSTAR (reloc_data.input_section->output_offset) #define SECTSTART (reloc_data.input_section->output_offset) #define _SDA_BASE_ (reloc_data.sdata_begin_symbol_vma) |