[binutils-gdb] Fix illegal memory access when linking a corrupt input file.

Nick Clifton nickc@sourceware.org
Thu Feb 6 09:55:38 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6be6e5b8ee95eda6f12f5bb0fbc2a17a42265ffb

commit 6be6e5b8ee95eda6f12f5bb0fbc2a17a42265ffb
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Feb 6 09:55:03 2025 +0000

    Fix illegal memory access when linking a corrupt input file.
    
    PR 32647

Diff:
---
 ld/ldelf.c | 1 +
 1 file changed, 1 insertion(+)

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))


More information about the Binutils-cvs mailing list