bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23207] New: hppa ld SIGSEGVs on invalid object files:


From: slyfox at inbox dot ru
Subject: [Bug ld/23207] New: hppa ld SIGSEGVs on invalid object files:
Date: Sat, 19 May 2018 21:11:57 +0000

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 (address@hidden, 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 (address@hidden,
address@hidden, address@hidden, 
    address@hidden, 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 (address@hidden,
info=0x55a629ef2a60 <link_info>, 
    address@hidden,
address@hidden, 
    contents=0x55a62a402aa0 "k\302?\331\b\003\002A\b\036\002Co\301",
address@hidden, 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
(address@hidden, address@hidden)
    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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]