https://sourceware.org/bugzilla/show_bug.cgi?id=23207
Bug ID: 23207 Summary: hppa ld SIGSEGVs on invalid object files: Product: binutils Version: 2.30 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: slyfox at inbox dot ru Target Milestone: --- Created attachment 11031 --> https://sourceware.org/bugzilla/attachment.cgi?id=11031&action=edit bug.o Original bug found on libressl: https://bugs.gentoo.org/656104 libressl itself has a bug that triggers binutils SIGSEGV. See fix if you are interested: https://github.com/libressl-portable/portable/pull/426 Steps to reproduce: Source file: // $ cat bug.i __asm__(".section .gnu.warning."); a() { b(); } Build as: $ hppa2.0-unknown-linux-gnu-gcc -fPIC -c bug.i -o bug.o $ hppa2.0-unknown-linux-gnu-gcc -shared -fPIC bug.o -o libbug.so ... collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped bug.o is also attached. gdb backtrace: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f761db022b4 in sprintf (__fmt=0x7f761db67feb "%08x_%s+%x", __s=0x55a62a3c5fb0 "\020p<*\246U") at /usr/include/bits/stdio2.h:33 33 return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, (gdb) bt #0 0x00007f761db022b4 in sprintf (__fmt=0x7f761db67feb "%08x_%s+%x", __s=0x55a62a3c5fb0 "\020p<*\246U") at /usr/include/bits/stdio2.h:33 #1 hppa_stub_name (hh=hh@entry=0x55a62a1d1040, rela=<optimized out>, rela=<optimized out>, sym_sec=<optimized out>, input_section=<optimized out>) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elf32-hppa.c:468 #2 0x00007f761db02399 in hppa_get_stub_entry (sym_sec=sym_sec@entry=0x0, hh=hh@entry=0x55a62a1d1040, rela=rela@entry=0x55a62a200b20, htab=htab@entry=0x55a62a1cfe90, input_section=<optimized out>) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elf32-hppa.c:517 #3 0x00007f761db045ab in final_link_relocate (info=0x55a629ef2a60 <link_info>, hh=0x55a62a1d1040, sym_sec=<optimized out>, htab=0x55a62a1cfe90, value=<optimized out>, rela=0x55a62a200b20, contents=0x55a62a402aa0 "k\302?\331\b\003\002A\b\036\002Co\301", input_section=0x55a62a1fe920) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elf32-hppa.c:3274 #4 elf32_hppa_relocate_section (output_bfd=output_bfd@entry=0x55a62a1cdb00, info=0x55a629ef2a60 <link_info>, input_bfd=input_bfd@entry=0x55a62a1eac50, input_section=input_section@entry=0x55a62a1fe920, contents=0x55a62a402aa0 "k\302?\331\b\003\002A\b\036\002Co\301", relocs=relocs@entry=0x55a62a200b20, local_syms=0x55a62a1fc1a0, local_sections=0x55a62a402fa0) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elf32-hppa.c:4174 #5 0x00007f761db2bb60 in elf_link_input_bfd (flinfo=flinfo@entry=0x7fffab228070, input_bfd=input_bfd@entry=0x55a62a1eac50) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elflink.c:10715 #6 0x00007f761db2d6af in bfd_elf_final_link () at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elflink.c:12033 #7 0x00007f761db0553b in elf32_hppa_final_link (abfd=0x55a62a1cdb00, info=0x55a629ef2a60 <link_info>) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/bfd/elf32-hppa.c:3143 #8 0x000055a629c9541f in ldwrite () at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/ld/ldwrite.c:581 #9 0x000055a629c7df30 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/cross-hppa2.0-unknown-linux-gnu/binutils-2.30-r2/binutils-2.30/ld/ldmain.c:456 -- 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