From: Alan Modra Date: Sat, 15 Feb 2025 21:59:27 +0000 (+1030) Subject: score-elf gas SEGV X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac8a1a52cf757b64373dfca8efc0e3041648a9f5;p=thirdparty%2Fbinutils-gdb.git score-elf gas SEGV Commit 3fb6f5457e5b typoed an array subscript. * config/tc-score7.c (s7_gen_reloc): Correct array subscript. * testsuite/gas/score/pr32700.d, * testsuite/gas/score/pr32700.s: New test. * testsuite/gas/score/relax.exp: Run it. --- diff --git a/gas/config/tc-score7.c b/gas/config/tc-score7.c index 63a720e3dd4..cb56ba9c177 100644 --- a/gas/config/tc-score7.c +++ b/gas/config/tc-score7.c @@ -6845,7 +6845,7 @@ s7_gen_reloc (asection * section ATTRIBUTE_UNUSED, fixS * fixp) s7_number_to_chars (buf, newval, s7_INSN_SIZE); retval[1] = notes_alloc (sizeof (arelent)); - retval[2]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *)); + retval[1]->sym_ptr_ptr = notes_alloc (sizeof (asymbol *)); retval[2] = NULL; *retval[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); retval[1]->address = (reloc->address + s7_RELAX_RELOC2 (fixp->fx_frag->fr_subtype)); diff --git a/gas/testsuite/gas/score/pr32700.d b/gas/testsuite/gas/score/pr32700.d new file mode 100644 index 00000000000..be814b86d11 --- /dev/null +++ b/gas/testsuite/gas/score/pr32700.d @@ -0,0 +1,14 @@ +#as: +#objdump: -dr +#source: pr32700.s + +.*: +file format .* + +Disassembly of section \.text: + +0+ <\.text>: + 0: 94388000 ldis r1, 0x0\(0\) + 0: R_SCORE_HI16 dwarf_reg_size_table + 4: 84348000 ori r1, 0x0 + 4: R_SCORE_LO16 dwarf_reg_size_table + 8: d8e18000 lbu r7, \[r1, 0\] diff --git a/gas/testsuite/gas/score/pr32700.s b/gas/testsuite/gas/score/pr32700.s new file mode 100644 index 00000000000..117b3c8ab4e --- /dev/null +++ b/gas/testsuite/gas/score/pr32700.s @@ -0,0 +1,2 @@ + .text + lbu r7,dwarf_reg_size_table diff --git a/gas/testsuite/gas/score/relax.exp b/gas/testsuite/gas/score/relax.exp index 184f9180e97..534a822f806 100644 --- a/gas/testsuite/gas/score/relax.exp +++ b/gas/testsuite/gas/score/relax.exp @@ -32,5 +32,5 @@ if [istarget score-*-*] then { run_dump_test "move" run_dump_test "rD_rA_BN" run_dump_test "rD_rA" + run_dump_test pr32700 } -