From: Alan Modra Date: Mon, 24 Nov 2025 08:44:16 +0000 (+1030) Subject: PR 33474 SEGV in init_reloc_cookie X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=500806dc2a341c0f2e36baf5a379a0b578b2ee2f;p=thirdparty%2Fbinutils-gdb.git PR 33474 SEGV in init_reloc_cookie This segfault is triggered by a tekhex input. PR 33474 * elflink.c (bfd_elf_gc_sections): Don't try to parse .eh_frame in non-ELF input files. --- diff --git a/bfd/elflink.c b/bfd/elflink.c index 60a0a0efd88..ec34c8abcf7 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -14649,6 +14649,8 @@ bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) asection *sec; struct elf_reloc_cookie cookie; + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; sec = sub->sections; if (sec == NULL || sec->sec_info_type == SEC_INFO_TYPE_JUST_SYMS) continue;