Fix illegal memory access when linking a corrupt input file.

PR 32647
This commit is contained in:
Nick Clifton
2025-02-06 09:55:03 +00:00
parent 7c40ebce17
commit 6be6e5b8ee

View File

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