From: Nick Clifton Date: Thu, 6 Feb 2025 09:55:03 +0000 (+0000) Subject: Fix illegal memory access when linking a corrupt input file. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6be6e5b8ee95eda6f12f5bb0fbc2a17a42265ffb;p=thirdparty%2Fbinutils-gdb.git Fix illegal memory access when linking a corrupt input file. PR 32647 --- diff --git a/ld/ldelf.c b/ld/ldelf.c index 141ee598a28..efa654c843c 100644 --- a/ld/ldelf.c +++ b/ld/ldelf.c @@ -2090,6 +2090,7 @@ elf_orphan_compatible (asection *in, asection *out) && (elf_next_in_group (out) != NULL || ((elf_section_flags (in) & SHF_LINK_ORDER) != 0 && (elf_section_flags (out) & SHF_LINK_ORDER) != 0 + && elf_linked_to_section (in) != NULL && (elf_linked_to_section (in)->output_section != elf_linked_to_section (out)->output_section)) || ((elf_section_flags (out) ^ elf_section_flags (in))