https://sourceware.org/bugzilla/show_bug.cgi?id=22127

            Bug ID: 22127
           Summary: as segfaults assembling invalid .reloc
           Product: binutils
           Version: 2.30 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: james410 at cowgill dot org.uk
  Target Milestone: ---

I just noticed that a source file containing an invalid .reloc involving local
symbols causes as to segfault. This affects at least x86_64 and mips (but
probably everything). This example was done for mips:

$ cat test.s
.reloc  .La,R_MIPS_32,.Lb

$ gdb --args ../build-mips/gas/as-new test.s
[...]
Reading symbols from ../build-mips/gas/as-new...done.
(gdb) r
Starting program: /srv/jcowgill-priv/workspace/binutils/build-mips/gas/as-new
test.s
test.s: Assembler messages:
test.s:2: Error: invalid offset expression

Program received signal SIGSEGV, Segmentation fault.
0x00005555555fda4c in resolve_reloc_expr_symbols () at
../../binutils-gdb/gas/write.c:736
736                       && (sec->use_rela_p
(gdb) p sec
$1 = (asection *) 0x0
(gdb) bt
#0  0x00005555555fda4c in resolve_reloc_expr_symbols () at
../../binutils-gdb/gas/write.c:736
#1  0x000055555560029b in write_object_file () at
../../binutils-gdb/gas/write.c:2034
#2  0x00005555555cc61c in main (argc=2, argv=0x5555559f8560) at
../../binutils-gdb/gas/as.c:1314

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to