]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR 33020 segv in _bfd_elf_strtab_offset
authorAlan Modra <amodra@gmail.com>
Fri, 30 May 2025 22:43:20 +0000 (08:13 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 30 May 2025 22:47:40 +0000 (08:17 +0930)
commitdc5b07c23bf6774ae9f84c8616e331cb7284363e
tree9d5bf2178a2cd3ed8ee0a9d21c88e53e2584b207
parent47d7ab705754543cd8b2671aae134163f22852c8
PR 33020 segv in _bfd_elf_strtab_offset

The PR fuzzer testcase creates a SHT_NOBITS .debug_info section, then
triggers a bug in --compress-debug-sections=zlib whereby sh_name is
set to -1 in elf_fake_sections as a flag to indicate the name is not
set yet (may change to zdebug_*), but the section never hits the debug
compression code in assign_file_positions_for_non_load_sections that
is responsible for setting sh_name.

PR 33020
* elf.c (_bfd_elf_init_reloc_shdr): Rename delay_st_name_p
param to delay_sh_name_p.
(elf_fake_sections): Rename delay_st_name_p to delay_sh_name_p.
Don't set delay_sh_name_p for no contents debug sections.
bfd/elf.c