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

            Bug ID: 33449
           Summary: A SEGV in _bfd_elf_eh_frame_section_offset at
                    elf-eh-frame.c:1813
           Product: binutils
           Version: 2.45
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: yfzhang23 at stu dot pku.edu.cn
  Target Milestone: ---

Created attachment 16345
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16345&action=edit
POC

## Description

- Version: Binutils 2.45
- Environment: Ubuntu 20.04.6 LTS, Clang 12.0.0

## Steps to reproduce

export CC="clang"
export CFLAGS="-g -fsanitize=address"
./configure
make -j
./ld/ld-new --no-undefined --orphan-handling discard -w -r -d $POC


## Sanitizer output

==139054==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc
0x0000007bc5b9 bp 0x7fff5e69f1b0 sp 0x7fff5e69ef10 T0)
==139054==The signal is caused by a READ memory access.
==139054==Hint: address points to the zero page.
    #0 0x7bc5b9 in _bfd_elf_eh_frame_section_offset
/benchmark/bin/binutils-2.45/bfd/elf-eh-frame.c:1813:52
    #1 0x6f12f7 in _bfd_elf_section_offset
/benchmark/bin/binutils-2.45/bfd/elf.c:13560:14
    #2 0x76a3fb in elf_link_input_bfd
/benchmark/bin/binutils-2.45/bfd/elflink.c:11987:23
    #3 0x75b599 in bfd_elf_final_link
/benchmark/bin/binutils-2.45/bfd/elflink.c:13185:11
    #4 0x545133 in ldwrite /benchmark/bin/binutils-2.45/ld/ldwrite.c:548:8
    #5 0x53cc51 in main /benchmark/bin/binutils-2.45/ld/./ldmain.c:912:3
    #6 0x7f5e08d9f082 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #7 0x41d6ad in _start (/benchmark/bin/binutils-2.45/ld/ld-new+0x41d6ad)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV
/benchmark/bin/binutils-2.45/bfd/elf-eh-frame.c:1813:52 in
_bfd_elf_eh_frame_section_offset
==139054==ABORTING

## Credit

Reported by Yifan Zhang, [PLL](https://pl.cs.pku.edu.cn/en/)

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

Reply via email to