Fixes to legacy ARC relocations.
Added support for ARC_SDA_12 reloc. Fixed ARC_N32_ME. Added ME (middle-endian) to ARC_SDA_12 reloc. bfd/ChangeLog: Cupertino Miranda <cmiranda@synopsys.com> * reloc.c: Fixed type in ARC_SECTOFF relocations. Added ARC_SDA_12 relocation. * bfd-in2.h: Regenerated from the previous changes. * libbfd.h: Regenerated from the previous changes. include/ChangeLog: Cupertino Miranda <cmiranda@synopsys.com> * elf/arc-reloc.def: Fixed relocation formula for N*, SDA, SDA_12, SDA_16_LD*, S13_PCREL, N32_ME, SECTOFF_* relocations. * opcode/arc-func.h (replace_disp12s): Added. Used for SDA_12 relocation.
This commit is contained in:
parent
0955507f6e
commit
a87aa054a6
7 changed files with 67 additions and 28 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2016-08-26 Cupertino Miranda <cmiranda@synopsys.com>
|
||||||
|
|
||||||
|
* reloc.c: Fixed type in ARC_SECTOFF relocations. Added ARC_SDA_12
|
||||||
|
relocation.
|
||||||
|
* bfd-in2.h: Regenerated from the previous changes.
|
||||||
|
* libbfd.h: Regenerated from the previous changes.
|
||||||
|
|
||||||
2016-08-26 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
2016-08-26 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||||
|
|
||||||
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add a new parameter for
|
* bfd-in.h (bfd_elf32_arm_set_target_relocs): Add a new parameter for
|
||||||
|
|
|
@ -3713,13 +3713,14 @@ pc-relative or some form of GOT-indirect relocation. */
|
||||||
BFD_RELOC_AC_SECTOFF_U8,
|
BFD_RELOC_AC_SECTOFF_U8,
|
||||||
BFD_RELOC_AC_SECTOFF_U8_1,
|
BFD_RELOC_AC_SECTOFF_U8_1,
|
||||||
BFD_RELOC_AC_SECTOFF_U8_2,
|
BFD_RELOC_AC_SECTOFF_U8_2,
|
||||||
BFD_RELOC_AC_SECTFOFF_S9,
|
BFD_RELOC_AC_SECTOFF_S9,
|
||||||
BFD_RELOC_AC_SECTFOFF_S9_1,
|
BFD_RELOC_AC_SECTOFF_S9_1,
|
||||||
BFD_RELOC_AC_SECTFOFF_S9_2,
|
BFD_RELOC_AC_SECTOFF_S9_2,
|
||||||
BFD_RELOC_ARC_SECTOFF_ME_1,
|
BFD_RELOC_ARC_SECTOFF_ME_1,
|
||||||
BFD_RELOC_ARC_SECTOFF_ME_2,
|
BFD_RELOC_ARC_SECTOFF_ME_2,
|
||||||
BFD_RELOC_ARC_SECTOFF_1,
|
BFD_RELOC_ARC_SECTOFF_1,
|
||||||
BFD_RELOC_ARC_SECTOFF_2,
|
BFD_RELOC_ARC_SECTOFF_2,
|
||||||
|
BFD_RELOC_ARC_SDA_12,
|
||||||
BFD_RELOC_ARC_SDA16_ST2,
|
BFD_RELOC_ARC_SDA16_ST2,
|
||||||
BFD_RELOC_ARC_32_PCREL,
|
BFD_RELOC_ARC_32_PCREL,
|
||||||
BFD_RELOC_ARC_PC32,
|
BFD_RELOC_ARC_PC32,
|
||||||
|
|
|
@ -1722,13 +1722,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
|
||||||
"BFD_RELOC_AC_SECTOFF_U8",
|
"BFD_RELOC_AC_SECTOFF_U8",
|
||||||
"BFD_RELOC_AC_SECTOFF_U8_1",
|
"BFD_RELOC_AC_SECTOFF_U8_1",
|
||||||
"BFD_RELOC_AC_SECTOFF_U8_2",
|
"BFD_RELOC_AC_SECTOFF_U8_2",
|
||||||
"BFD_RELOC_AC_SECTFOFF_S9",
|
"BFD_RELOC_AC_SECTOFF_S9",
|
||||||
"BFD_RELOC_AC_SECTFOFF_S9_1",
|
"BFD_RELOC_AC_SECTOFF_S9_1",
|
||||||
"BFD_RELOC_AC_SECTFOFF_S9_2",
|
"BFD_RELOC_AC_SECTOFF_S9_2",
|
||||||
"BFD_RELOC_ARC_SECTOFF_ME_1",
|
"BFD_RELOC_ARC_SECTOFF_ME_1",
|
||||||
"BFD_RELOC_ARC_SECTOFF_ME_2",
|
"BFD_RELOC_ARC_SECTOFF_ME_2",
|
||||||
"BFD_RELOC_ARC_SECTOFF_1",
|
"BFD_RELOC_ARC_SECTOFF_1",
|
||||||
"BFD_RELOC_ARC_SECTOFF_2",
|
"BFD_RELOC_ARC_SECTOFF_2",
|
||||||
|
"BFD_RELOC_ARC_SDA_12",
|
||||||
"BFD_RELOC_ARC_SDA16_ST2",
|
"BFD_RELOC_ARC_SDA16_ST2",
|
||||||
"BFD_RELOC_ARC_32_PCREL",
|
"BFD_RELOC_ARC_32_PCREL",
|
||||||
"BFD_RELOC_ARC_PC32",
|
"BFD_RELOC_ARC_PC32",
|
||||||
|
|
|
@ -3613,11 +3613,11 @@ ENUMX
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_AC_SECTOFF_U8_2
|
BFD_RELOC_AC_SECTOFF_U8_2
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_AC_SECTFOFF_S9
|
BFD_RELOC_AC_SECTOFF_S9
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_AC_SECTFOFF_S9_1
|
BFD_RELOC_AC_SECTOFF_S9_1
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_AC_SECTFOFF_S9_2
|
BFD_RELOC_AC_SECTOFF_S9_2
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_ARC_SECTOFF_ME_1
|
BFD_RELOC_ARC_SECTOFF_ME_1
|
||||||
ENUMX
|
ENUMX
|
||||||
|
@ -3626,6 +3626,8 @@ ENUMX
|
||||||
BFD_RELOC_ARC_SECTOFF_1
|
BFD_RELOC_ARC_SECTOFF_1
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_ARC_SECTOFF_2
|
BFD_RELOC_ARC_SECTOFF_2
|
||||||
|
ENUMX
|
||||||
|
BFD_RELOC_ARC_SDA_12
|
||||||
ENUMX
|
ENUMX
|
||||||
BFD_RELOC_ARC_SDA16_ST2
|
BFD_RELOC_ARC_SDA16_ST2
|
||||||
ENUMX
|
ENUMX
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2016-08-26 Cupertino Miranda <cmiranda@synopsys.com>
|
||||||
|
* elf/arc-reloc.def: Fixed relocation formula for N*, SDA, SDA_12,
|
||||||
|
SDA_16_LD*, S13_PCREL, N32_ME, SECTOFF_* relocations.
|
||||||
|
* opcode/arc-func.h (replace_disp12s): Added. Used for SDA_12
|
||||||
|
relocation.
|
||||||
|
|
||||||
2016-08-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
2016-08-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
||||||
|
|
||||||
* arm.h (ARM_GET_SYM_CMSE_SPCL): Define macro.
|
* arm.h (ARM_GET_SYM_CMSE_SPCL): Define macro.
|
||||||
|
|
|
@ -69,35 +69,35 @@ ARC_RELOC_HOWTO(ARC_N8, 8, \
|
||||||
8, \
|
8, \
|
||||||
replace_bits8, \
|
replace_bits8, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( S - A ))
|
( A - S ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_N16, 9, \
|
ARC_RELOC_HOWTO(ARC_N16, 9, \
|
||||||
1, \
|
1, \
|
||||||
16, \
|
16, \
|
||||||
replace_bits16, \
|
replace_bits16, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( S - A ))
|
( A - S ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_N24, 10, \
|
ARC_RELOC_HOWTO(ARC_N24, 10, \
|
||||||
2, \
|
2, \
|
||||||
24, \
|
24, \
|
||||||
replace_bits24, \
|
replace_bits24, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( S - A ))
|
( A - S ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_N32, 11, \
|
ARC_RELOC_HOWTO(ARC_N32, 11, \
|
||||||
2, \
|
2, \
|
||||||
32, \
|
32, \
|
||||||
replace_word32, \
|
replace_word32, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( S - A ))
|
( A - S ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SDA, 12, \
|
ARC_RELOC_HOWTO(ARC_SDA, 12, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9, \
|
replace_disp9, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( S + A ))
|
( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SECTOFF, 13, \
|
ARC_RELOC_HOWTO(ARC_SECTOFF, 13, \
|
||||||
2, \
|
2, \
|
||||||
|
@ -167,28 +167,28 @@ ARC_RELOC_HOWTO(ARC_SDA16_LD, 22, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9s, \
|
replace_disp9s, \
|
||||||
signed, \
|
signed, \
|
||||||
( ( ( S + A ) - _SDA_BASE_ ) ))
|
( ( S + A ) - _SDA_BASE_ ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SDA16_LD1, 23, \
|
ARC_RELOC_HOWTO(ARC_SDA16_LD1, 23, \
|
||||||
1, \
|
1, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9s, \
|
replace_disp9s, \
|
||||||
signed, \
|
signed, \
|
||||||
( ( ( ( S + A ) - _SDA_BASE_ ) >> 1 ) ))
|
( ( ( S + A ) - _SDA_BASE_ ) >> 1 ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SDA16_LD2, 24, \
|
ARC_RELOC_HOWTO(ARC_SDA16_LD2, 24, \
|
||||||
1, \
|
1, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9s, \
|
replace_disp9s, \
|
||||||
signed, \
|
signed, \
|
||||||
( ( ( ( S + A ) - _SDA_BASE_ ) >> 2 ) ))
|
( ( ( S + A ) - _SDA_BASE_ ) >> 2 ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_S13_PCREL, 25, \
|
ARC_RELOC_HOWTO(ARC_S13_PCREL, 25, \
|
||||||
1, \
|
1, \
|
||||||
11, \
|
11, \
|
||||||
replace_disp13s, \
|
replace_disp13s, \
|
||||||
signed, \
|
signed, \
|
||||||
( ( ( ( S + A ) - P ) >> 2 ) ))
|
( ( ( S + A ) - P ) >> 2 ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_W, 26, \
|
ARC_RELOC_HOWTO(ARC_W, 26, \
|
||||||
2, \
|
2, \
|
||||||
|
@ -216,7 +216,7 @@ ARC_RELOC_HOWTO(ARC_N32_ME, 28, \
|
||||||
32, \
|
32, \
|
||||||
replace_word32, \
|
replace_word32, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ME ( ( S - A ) ) ))
|
( ME ( ( A - S ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SECTOFF_ME, 29, \
|
ARC_RELOC_HOWTO(ARC_SECTOFF_ME, 29, \
|
||||||
2, \
|
2, \
|
||||||
|
@ -244,42 +244,42 @@ ARC_RELOC_HOWTO(AC_SECTOFF_U8, 35, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( S + A ) - SECTSTART ))
|
( ME ( ( ( S + A ) - SECTSTART ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(AC_SECTOFF_U8_1, 36, \
|
ARC_RELOC_HOWTO(AC_SECTOFF_U8_1, 36, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( ( S + A ) - SECTSTART ) >> 1 ))
|
( ME ( ( ( ( S + A ) - SECTSTART ) >> 1 ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(AC_SECTOFF_U8_2, 37, \
|
ARC_RELOC_HOWTO(AC_SECTOFF_U8_2, 37, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( ( S + A ) - SECTSTART ) >> 2 ))
|
( ME ( ( ( ( S + A ) - SECTSTART ) >> 2 ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(AC_SECTFOFF_S9, 38, \
|
ARC_RELOC_HOWTO(AC_SECTOFF_S9, 38, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( S + A ) - SECTSTART ))
|
( ME ( ( ( ( S + A ) - SECTSTART ) - 256 ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(AC_SECTFOFF_S9_1, 39, \
|
ARC_RELOC_HOWTO(AC_SECTOFF_S9_1, 39, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( ( S + A ) - SECTSTART ) >> 1 ))
|
( ME ( ( ( ( ( S + A ) - SECTSTART ) - 256 ) >> 1 ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(AC_SECTFOFF_S9_2, 40, \
|
ARC_RELOC_HOWTO(AC_SECTOFF_S9_2, 40, \
|
||||||
2, \
|
2, \
|
||||||
9, \
|
9, \
|
||||||
replace_disp9ls, \
|
replace_disp9ls, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( ( S + A ) - SECTSTART ) >> 2 ))
|
( ME ( ( ( ( ( S + A ) - SECTSTART ) - 256 ) >> 2 ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1, 41, \
|
ARC_RELOC_HOWTO(ARC_SECTOFF_ME_1, 41, \
|
||||||
2, \
|
2, \
|
||||||
|
@ -309,6 +309,13 @@ ARC_RELOC_HOWTO(ARC_SECTOFF_2, 44, \
|
||||||
bitfield, \
|
bitfield, \
|
||||||
( ( ( S - SECTSTART ) + A ) >> 2 ))
|
( ( ( S - SECTSTART ) + A ) >> 2 ))
|
||||||
|
|
||||||
|
ARC_RELOC_HOWTO(ARC_SDA_12, 45, \
|
||||||
|
2, \
|
||||||
|
12, \
|
||||||
|
replace_disp12s, \
|
||||||
|
signed, \
|
||||||
|
( ME ( ( ( S + A ) - _SDA_BASE_ ) ) ))
|
||||||
|
|
||||||
ARC_RELOC_HOWTO(ARC_SDA16_ST2, 48, \
|
ARC_RELOC_HOWTO(ARC_SDA16_ST2, 48, \
|
||||||
1, \
|
1, \
|
||||||
9, \
|
9, \
|
||||||
|
|
|
@ -264,3 +264,18 @@ replace_disp9s1 (unsigned insn, int value ATTRIBUTE_UNUSED)
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* REPLACE_disp9s1 */
|
#endif /* REPLACE_disp9s1 */
|
||||||
|
|
||||||
|
/* mask = 00000000000000000000111111222222. */
|
||||||
|
#ifndef REPLACE_disp12s
|
||||||
|
#define REPLACE_disp12s
|
||||||
|
ATTRIBUTE_UNUSED static unsigned
|
||||||
|
replace_disp12s (unsigned insn, int value ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
insn = insn & ~0xfff;
|
||||||
|
insn |= ((value >> 0) & 0x003f) << 6;
|
||||||
|
insn |= ((value >> 6) & 0x003f) << 0;
|
||||||
|
|
||||||
|
return insn;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* REPLACE_disp12s */
|
||||||
|
|
Loading…
Reference in a new issue