]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix illegal memory access when linking a corrupt input file.
authorNick Clifton <nickc@redhat.com>
Thu, 6 Feb 2025 09:55:03 +0000 (09:55 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 6 Feb 2025 09:55:03 +0000 (09:55 +0000)
PR 32647

ld/ldelf.c

index 141ee598a2813b0968c80c4cc5cb6024914eeabe..efa654c843c90685de1837f526ed5a26eb1b2a25 100644 (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))