diff options
author | Maciej W. Rozycki <macro@mips.com> | 2018-07-02 23:57:22 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@mips.com> | 2018-07-02 23:57:22 +0100 |
commit | 156f2c001e22dfeee69c92bdb380d5eb28a3de78 (patch) | |
tree | e4f442c8336bd2b7c84ead22f8a0e045f876e102 /gas | |
parent | 30e5322741b7cb8fe90bec43ab93eecceaaec0e7 (diff) | |
download | binutils-156f2c001e22dfeee69c92bdb380d5eb28a3de78.zip binutils-156f2c001e22dfeee69c92bdb380d5eb28a3de78.tar.gz binutils-156f2c001e22dfeee69c92bdb380d5eb28a3de78.tar.bz2 |
microMIPS/BFD: Add missing NewABI TLS and miscellaneous relocations
Complement commit df58fc944dbc ("MIPS: microMIPS ASE support"),
<https://sourceware.org/ml/binutils/2011-07/msg00198.html>, and add TLS
and a few miscellaneous relocations to NewABI microMIPS support, fixing
GAS assertion failures:
.../gas/testsuite/gas/mips/elf-rel28.s: Assembler messages:
.../gas/testsuite/gas/mips/elf-rel28.s:19: Internal error in append_insn at .../gas/config/tc-mips.c:7660.
Please report this bug.
observed if an attempt is made to assemble the `elf-rel28.s' test case
to microMIPS code. The relocations are the same as with o32 support,
except for `partial_inplace' and `src_mask' updates for the respective
RELA variants.
bfd/
* elf64-mips.c (micromips_elf64_howto_table_rel): Add
R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
R_MICROMIPS_PC23_S2 relocation entries.
(micromips_elf64_howto_table_rela): Likewise.
(micromips_reloc_map): Likewise.
* elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
(elf_micromips_howto_table_rela): Likewise.
(micromips_reloc_map): Likewise.
gas/
* testsuite/gas/mips/elf-rel28-micromips-n32.d: New test.
* testsuite/gas/mips/elf-rel28-micromips-n64.d: New test.
* testsuite/gas/mips/mips.exp: Run the new tests.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/elf-rel28-micromips-n32.d | 96 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/elf-rel28-micromips-n64.d | 180 | ||||
-rw-r--r-- | gas/testsuite/gas/mips/mips.exp | 2 |
4 files changed, 284 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 47fa7ae..bf5368c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2018-07-02 Maciej W. Rozycki <macro@mips.com> + + * testsuite/gas/mips/elf-rel28-micromips-n32.d: New test. + * testsuite/gas/mips/elf-rel28-micromips-n64.d: New test. + * testsuite/gas/mips/mips.exp: Run the new tests. + 2018-07-02 Thomas Preud'homme <thomas.preudhomme@arm.com> * config/tc-arm.c (cpu_arch_ver): Use symbolic TAG_CPU_ARCH macros diff --git a/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d b/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d new file mode 100644 index 0000000..a5a504e --- /dev/null +++ b/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d @@ -0,0 +1,96 @@ +#source: elf-rel28.s +#as: -march=from-abi -mmicromips -n32 +#objdump: -dr +#name: MIPS ELF reloc 28 (microMIPS, n32) + +.*: file format .* + + +Disassembly of section \.text: + +.* <foo>: +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL_HI16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL_LO16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_DISP bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_PAGE bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_OFST bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_HI16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_LO16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GPREL16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MIPS_16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_HIGHEST bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_HIGHER bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_SUB bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_GD bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_LDM bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_HI16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_LO16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_HI16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_LO16 bar +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_GOTTPREL bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL_HI16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL_LO16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_DISP bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_PAGE bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_OFST bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_HI16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_LO16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GPREL16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MIPS_16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_HIGHEST bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_HIGHER bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_SUB bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_GD bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_LDM bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_HI16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_LO16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_HI16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_LO16 bar +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_GOTTPREL bar + \.\.\. diff --git a/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d b/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d new file mode 100644 index 0000000..5d96ebb --- /dev/null +++ b/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d @@ -0,0 +1,180 @@ +#source: elf-rel28.s +#as: -march=from-abi -mmicromips -64 +#objdump: -dr +#name: MIPS ELF reloc 28 (microMIPS, n64) + +.*: file format .* + + +Disassembly of section \.text: + +.* <foo>: +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_CALL16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_DISP bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_PAGE bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_OFST bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GOT16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_GPREL16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MIPS_16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_HIGHEST bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_HIGHER bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_SUB bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_GD bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_LDM bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: dc84 0000 ld a0,0\(a0\) + .*: R_MICROMIPS_TLS_GOTTPREL bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_CALL16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_DISP bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_PAGE bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_OFST bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GOT16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_GPREL16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MIPS_16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_HIGHEST bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_HIGHER bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_SUB bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_GD bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_LDM bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_DTPREL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_HI16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_TPREL_LO16 bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* +.*: d884 0000 sd a0,0\(a0\) + .*: R_MICROMIPS_TLS_GOTTPREL bar + .*: R_MIPS_NONE \*ABS\* + .*: R_MIPS_NONE \*ABS\* + \.\.\. diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index 786168d..49b4386 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -1221,7 +1221,9 @@ if { [istarget mips*-*-vxworks*] } { if $has_newabi { run_dump_test "elf-rel28-n32" + run_dump_test "elf-rel28-micromips-n32" run_dump_test "elf-rel28-n64" + run_dump_test "elf-rel28-micromips-n64" run_dump_test_arches "elf-rel29" [mips_arch_list_matching mips3] } run_list_test_arches "elf-rel30" "-32" [mips_arch_list_all] |