mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
70e65ca8e5
Fix a bug in commit a6ebf6169a
("MIPS: Convert cross-mode BAL to
JALX") and in BFD linker relaxation correct the microMIPS interpretation
of the branch offset, which is supposed to be shifted by 1 bit, rather
than 2 as in the regular MIPS case.
bfd/
* elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
branch offset interpretation.
gas/
* testsuite/gas/mips/branch-addend-micromips.d: New test.
* testsuite/gas/mips/branch-addend-micromips-n32.d: New test.
* testsuite/gas/mips/branch-addend-micromips-n64.d: New test.
* testsuite/gas/mips/branch-addend-micromips.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.
ld/
* testsuite/ld-mips-elf/bal-jalx-addend-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d: New test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d: New
test.
* testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d: New
test.
* testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
23 lines
803 B
Makefile
23 lines
803 B
Makefile
#name: microMIPS BAL/JALX in PIC mode (ignore branch ISA)
|
|
#source: ../../../gas/testsuite/gas/mips/branch-addend-micromips.s
|
|
#as: -EB -32
|
|
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000 -shared --ignore-branch-isa
|
|
#objdump: -dr --prefix-addresses --show-raw-insn
|
|
|
|
.*: +file format .*mips.*
|
|
|
|
Disassembly of section \.text:
|
|
\.\.\.
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
[0-9a-f]+ <[^>]*> 00000000 nop
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
[0-9a-f]+ <[^>]*> 4060 7ff4 bal 0*1c011000 <.*>
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
[0-9a-f]+ <[^>]*> 4060 7ff8 bal 0*1c011010 <.*>
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
\.\.\.
|