mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
a6ebf6169a
Convert cross-mode regular MIPS and microMIPS BAL instructions to JALX, similarly to how JAL instructions are converted. bfd/ * elfxx-mips.c (mips_elf_perform_relocation): Convert cross-mode BAL to JALX. (_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Add a corresponding error message. gas/ * config/tc-mips.c (mips_force_relocation, mips_fix_adjustable): Adjust comments for BAL to JALX linker conversion. (fix_bad_cross_mode_branch_p): Accept cross-mode BAL. * testsuite/gas/mips/unaligned-branch-1.l: Update error messages expected. * testsuite/gas/mips/unaligned-branch-micromips-1.l: Likewise. * testsuite/gas/mips/branch-local-4.d: New test. * testsuite/gas/mips/branch-local-n32-4.d: New test. * testsuite/gas/mips/branch-local-n64-4.d: New test. * testsuite/gas/mips/branch-addend.d: New test. * testsuite/gas/mips/branch-addend-n32.d: New test. * testsuite/gas/mips/branch-addend-n64.d: New test. * testsuite/gas/mips/branch-local-4.s: New test source. * testsuite/gas/mips/branch-addend.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. ld/ * testsuite/ld-mips-elf/unaligned-branch-2.d: Update error messages expected. * testsuite/ld-mips-elf/unaligned-branch-r6-1.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-mips16.d: Likewise. * testsuite/ld-mips-elf/unaligned-branch-micromips.d: Likewise. * testsuite/ld-mips-elf/bal-jalx-addend.d: New test. * testsuite/ld-mips-elf/bal-jalx-local.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-n32.d: New test. * testsuite/ld-mips-elf/bal-jalx-addend-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-local-n64.d: New test. * testsuite/ld-mips-elf/bal-jalx-pic-n64.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-3.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-addend-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-2.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-3.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-addend-2.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-addend-3.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
23 lines
755 B
Makefile
23 lines
755 B
Makefile
#name: MIPS BAL/JALX addend calculation
|
|
#source: ../../../gas/testsuite/gas/mips/branch-addend.s
|
|
#as: -EB -32
|
|
#ld: -EB -Ttext 0x1c000000 -e 0x1c000000
|
|
#objdump: -dr --prefix-addresses --show-raw-insn
|
|
|
|
.*: +file format .*mips.*
|
|
|
|
Disassembly of section \.text:
|
|
\.\.\.
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
[0-9a-f]+ <[^>]*> 001f 0f3c jr ra
|
|
[0-9a-f]+ <[^>]*> 0000 02d0 not zero,zero
|
|
[0-9a-f]+ <[^>]*> 0000 0000 nop
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
[0-9a-f]+ <[^>]*> 77008400 jalx 0*1c021000 <.*>
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
[0-9a-f]+ <[^>]*> 04117ffc bal 0*1c021010 <.*>
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
[0-9a-f]+ <[^>]*> 03e00009 jalr zero,ra
|
|
[0-9a-f]+ <[^>]*> 00000027 nor zero,zero,zero
|
|
\.\.\.
|