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

            Bug ID: 33625
           Summary: SEGV in bfd/elf64-hppa.c:2372, target hppa64-linux
           Product: binutils
           Version: 2.46 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: pheeck at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: hppa64-linux

If you configure binutils like this

./configure --build=x86_64-linux --disable-gdb --disable-gdbserver
--disable-werror --target=hppa64-linux

and run the testsuite.

make -j16 && make -j16 check -k

In ld/ld.log, you find

./ld-new  -z nomemory-seal  -L/home/fkastl/foo/binutils-gdb/ld/testsuite/ld-elf
 -pie --no-dynamic-linker -o tmpdir/dump tmpdir/pr22269.o 
Executing on host: sh -c {./ld-new  -z nomemory-seal 
-L/home/fkastl/foo/binutils-gdb/ld/testsuite/ld-elf  -pie --no-dynamic-linker
-o tmpdir/dump tmpdir/pr22269.o  2>&1}  /dev/null dump.tmp (timeout = 300)
spawn [open ...]
failed with: <>, no expected output
FAIL: PR ld/22269

If you run

./ld-new  -z nomemory-seal  -L/home/fkastl/foo/binutils-gdb/ld/testsuite/ld-elf
 -pie --no-dynamic-linker -o tmpdir/dump tmpdir/pr22269.o

it segfaults.

I originally discovered this with Address Sanitizer.  It provides a stack
trace:

elf64-hppa.c:2372:50: runtime error: member access within null pointer of type
'struct bfd_section'
AddressSanitizer:DEADLYSIGNAL
=================================================================
==202874==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000030 (pc
0x0000005b09d9 bp 0x7b86314312e0 sp 0x7fff4b6a88c0 T0)
==202874==The signal is caused by a READ memory access.
==202874==Hint: address points to the zero page.
    #0 0x0000005b09d9 in elf64_hppa_finalize_dynreloc
/home/fkastl/foo/binutils-gdb/bfd/elf64-hppa.c:2372
    #1 0x00000054cda5 in bfd_link_hash_traverse
/home/fkastl/foo/binutils-gdb/bfd/linker.c:693
    #2 0x0000005d10bc in elf_link_hash_traverse
/home/fkastl/foo/binutils-gdb/bfd/elf-bfd.h:808
    #3 0x0000005d10bc in elf64_hppa_finish_dynamic_sections
/home/fkastl/foo/binutils-gdb/bfd/elf64-hppa.c:2449
    #4 0x0000007475be in bfd_elf_final_link
/home/fkastl/foo/binutils-gdb/bfd/elflink.c:13735
    #5 0x0000005d293b in elf64_hppa_final_link
/home/fkastl/foo/binutils-gdb/bfd/elf64-hppa.c:2995
    #6 0x0000004ba80f in ldwrite /home/fkastl/foo/binutils-gdb/ld/ldwrite.c:548
    #7 0x00000041abfd in main ldmain.c:905
    #8 0x7f8633a2b2fa in __libc_start_call_main (/lib64/libc.so.6+0x2b2fa)
(BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #9 0x7f8633a2b3ca in __libc_start_main_impl (/lib64/libc.so.6+0x2b3ca)
(BuildId: 8523b213e7586a93ab00f6dd476418b1e521e62c)
    #10 0x00000041d3e4 in _start ../sysdeps/x86_64/start.S:115

==202874==Register values:
rax = 0x0000000000000000  rbx = 0x00007d96328026e8  rcx = 0x00007f8633e1ceab 
rdx = 0x0000000000000030  
rdi = 0x00000000005b1e83  rsi = 0x0000000000000006  rbp = 0x00007b86314312e0 
rsp = 0x00007fff4b6a88c0  
 r8 = 0x00007fff4b6a82f4   r9 = 0x00000f70c6286254  r10 = 0x0000000000000000 
r11 = 0x0000000000000000  
r12 = 0x00007d56327e0080  r13 = 0x00007d96327f6d48  r14 = 0x00000000013e89a0 
r15 = 0x00007ca6327e01c0  
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/home/fkastl/foo/binutils-gdb/bfd/elf64-hppa.c:2372 in
elf64_hppa_finalize_dynreloc
==202874==ABORTING
failed with: <elf64-hppa.c:2372:50: runtime error: member access within null
pointer of type 'struct bfd_section'

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to