]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation
authorMaciej W. Rozycki <macro@imgtec.com>
Wed, 30 Aug 2017 15:03:31 +0000 (16:03 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 30 Aug 2017 15:24:23 +0000 (16:24 +0100)
commit5f3af8cbbc70b4859b7559b35324236a4658f2c8
tree946f32b1deed314bedd2fd1f0658960d45c04e4c
parent278fcf38584dd22b992e1da179c06883c2b7d108
MIPS/BFD: Correct microMIPS cross-mode BAL to JALX relaxation

Fix a bug in commit a6ebf6169a1b ("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.

(cherry picked from commit 70e65ca8e5d1fc984d58f6137c290e807fe772a5)
22 files changed:
bfd/ChangeLog
bfd/elfxx-mips.c
gas/ChangeLog
gas/testsuite/gas/mips/branch-addend-micromips-n32.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-addend-micromips-n64.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-addend-micromips.d [new file with mode: 0644]
gas/testsuite/gas/mips/branch-addend-micromips.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp
ld/ChangeLog
ld/testsuite/ld-mips-elf/bal-jalx-addend-micromips-n32.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-addend-micromips-n64.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-addend-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-local-micromips-n32.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-local-micromips-n64.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-local-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n32.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips-n64.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-ignore-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/bal-jalx-pic-micromips.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/mips-elf.exp