https://sourceware.org/bugzilla/show_bug.cgi?id=33020
Bug ID: 33020
Summary: Segmentation Fault in _bfd_elf_strtab_offset During
Object Content Writing
Product: binutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: xdcao.cs at gmail dot com
Target Milestone: ---
Summary
Segmentation Fault in _bfd_elf_strtab_offset During Object Content Writing
Environment
GNU Binutils version: 2.44.50 & master
OS: Ubuntu 22.04.5 LTS
Steps to reproduce
# export CFLAGS="-g -O0 -fno-inline -fno-lto -fsanitize=address"
# export CXXFLAGS="-g -O0 -fno-inline -fno-lto -fsanitize=address"
# ./configure --disable-werror --enable-targets=all --enable-gold[=yes]
# make -j64 & make install
root@c6c01f72391e:# ./ld-new --compress-debug-sections zlib --gc-sections POC
./ld-new: warning: cannot find entry symbol _start; not setting start address
./ld-new: BFD (GNU Binutils) 2.44.50.20250417 assertion fail elf-strtab.c:290
AddressSanitizer:DEADLYSIGNAL
=================================================================
==955057==ERROR: AddressSanitizer: SEGV on unknown address 0x6158000007f8 (pc
0x000000dcb551 bp 0x0c0e00000036 sp 0x7ffef7e117a0 T0)
==955057==The signal is caused by a READ memory access.
#0 0xdcb551 in _bfd_elf_strtab_offset
/workspace/new-test/program/binutils-gdb/bfd/elf-strtab.c:292:11
#1 0xd0933c in _bfd_elf_write_object_contents
/workspace/new-test/program/binutils-gdb/bfd/elf.c:7164:6
#2 0xc39cfa in bfd_close
/workspace/new-test/program/binutils-gdb/bfd/opncls.c:865:11
#3 0x53b30b in main
/workspace/new-test/program/binutils-gdb/ld/./ldmain.c:954:12
#4 0x7f332fd17d8f in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16
POC
https://drive.google.com/file/d/1jBPDK0fuIC0gKmJjTeqy3ntDsMIxc5b9/view?usp=sharing
redit
Xiaoguo Li (CUPL)
Xudong Cao (UCAS)
--
You are receiving this mail because:
You are on the CC list for the bug.