binutils-gdb/ld/testsuite/ld-mips-elf/unaligned-branch.d
Maciej W. Rozycki 99aefae681 MIPS/BFD: Correctly handle `bfd_reloc_outofrange' with branches
Fix internal errors like:

ld: BFD (GNU Binutils) 2.26.51.20160526 internal error, aborting at .../bfd/elfxx-mips.c:10278 in _bfd_mips_elf_relocate_section

ld: Please report this bug.

triggered by the `bfd_reloc_outofrange' condition on branch relocations.

	bfd/
	* elfxx-mips.c (b_reloc_p): New function.
	(_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Handle
	branch relocations.

	ld/
	* testsuite/ld-mips-elf/unaligned-branch.d: New test.
	* testsuite/ld-mips-elf/unaligned-branch.s: New test source.
	* testsuite/ld-mips-elf/unaligned-text.s: New test source.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
2016-05-28 10:59:45 +01:00

24 lines
1.1 KiB
Makefile

#name: MIPS branch to unaligned symbol
#source: unaligned-branch.s
#source: unaligned-text.s
#as: -EB -32 -mips32r6
#ld: -EB -Ttext 0x10000000 -e 0x10000000
#error: \A[^\n]*: In function `foo':\n
#error: \(\.text\+0x14\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x1c\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x24\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x28\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x30\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x38\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x3c\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x44\): Branch to a non-instruction-aligned address\n
#error: [^\n]*: In function `foo':\n
#error: \(\.text\+0x4c\): Branch to a non-instruction-aligned address\Z