aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2016-05-25 20:59:37 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2016-05-25 21:03:22 +0100
commitde341542a60f7d3a80cc339db7d341b615cfa52f (patch)
tree49433d00589276b80ebc6f63f7933623ebd5b9c8 /ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s
parentf3ad76370f8c79e4ae74ca6826e23bf417d5283a (diff)
downloadgdb-de341542a60f7d3a80cc339db7d341b615cfa52f.zip
gdb-de341542a60f7d3a80cc339db7d341b615cfa52f.tar.gz
gdb-de341542a60f7d3a80cc339db7d341b615cfa52f.tar.bz2
MIPS/BFD: Report `bfd_reloc_outofrange' errors as such
A `bfd_reloc_outofrange' condition from `mips_elf_calculate_relocation' currently triggers the warning callback, which in the case of LD prints messages like: foo.o: In function `foo': (.text+0x0): warning: JALX to a non-word-aligned address or: foo.o: In function `foo': (.text+0x0): warning: PC-relative load from unaligned address and nothing else, which suggests this is a benign condition and link has otherwise successfully run to completion. This is however not the case, the link terminates right away with no further messages and no output produced. Use the general error or warning info callback then, preserving the message format. Also set a BFD error condition so that a failure is unambiguously reported. Complement the change with a set of suitable test suite additions. bfd/ * elfxx-mips.c (_bfd_mips_elf_relocate_section) <bfd_reloc_outofrange>: Call `->einfo' rather than `->warning'. Call `bfd_set_error'. ld/ * testsuite/ld-mips-elf/unaligned-jalx-0.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-1.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-mips16-0.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-mips16-2.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-micromips-0.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-micromips-2.d: New test. * testsuite/ld-mips-elf/unaligned-lwpc-0.d: New test. * testsuite/ld-mips-elf/unaligned-lwpc-1.d: New test. * testsuite/ld-mips-elf/unaligned-lwpc-2.d: New test. * testsuite/ld-mips-elf/unaligned-lwpc-3.d: New test. * testsuite/ld-mips-elf/unaligned-ldpc-0.d: New test. * testsuite/ld-mips-elf/unaligned-ldpc-1.d: New test. * testsuite/ld-mips-elf/unaligned-ldpc-2.d: New test. * testsuite/ld-mips-elf/unaligned-ldpc-3.d: New test. * testsuite/ld-mips-elf/unaligned-ldpc-4.d: New test. * testsuite/ld-mips-elf/unaligned-jalx-0.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-1.s: New test source. * testsuite/ld-mips-elf/unaligned-jalx-2.s: New test source. * testsuite/ld-mips-elf/unaligned-insn.s: New test source. * testsuite/ld-mips-elf/unaligned-lwpc-0.s: New test source. * testsuite/ld-mips-elf/unaligned-lwpc-1.s: New test source. * testsuite/ld-mips-elf/unaligned-lwpc-2.s: New test source. * testsuite/ld-mips-elf/unaligned-lwpc-3.s: New test source. * testsuite/ld-mips-elf/unaligned-ldpc-0.s: New test source. * testsuite/ld-mips-elf/unaligned-ldpc-1.s: New test source. * testsuite/ld-mips-elf/unaligned-ldpc-2.s: New test source. * testsuite/ld-mips-elf/unaligned-ldpc-3.s: New test source. * testsuite/ld-mips-elf/unaligned-ldpc-4.s: New test source. * testsuite/ld-mips-elf/unaligned-syms.s: New test source. * testsuite/ld-mips-elf/mips-elf.exp: Run the new tests.
Diffstat (limited to 'ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s')
-rw-r--r--ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s b/ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s
new file mode 100644
index 0000000..c99b4b7
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/unaligned-ldpc-0.s
@@ -0,0 +1,11 @@
+ .text
+ .align 4
+ .globl foo
+ .ent foo
+foo:
+ ldpc $2, bar0
+ .end foo
+
+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .align 4, 0
+ .space 16