[all-commits] [llvm/llvm-project] 71f9b1: [llvm-objcopy] [COFF] Ignore associative sections ...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri Aug 1 00:10:51 PDT 2025


  Branch: refs/heads/release/21.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 71f9b12e1b5a9aeccbabad733664ab7a6fb99b16
      https://github.com/llvm/llvm-project/commit/71f9b12e1b5a9aeccbabad733664ab7a6fb99b16
  Author: Martin Storsjö <martin at martin.st>
  Date:   2025-08-01 (Fri, 01 Aug 2025)

  Changed paths:
    M llvm/lib/ObjCopy/COFF/COFFReader.cpp
    A llvm/test/tools/llvm-objcopy/COFF/exe-bogus-assoc.test

  Log Message:
  -----------
  [llvm-objcopy] [COFF] Ignore associative sections in executables (#151143)

COFF associative sections is a feature where relocatable object files
can have section snippets marked as related to another section snippet,
so they are kept or discarded in relation to that other section snippet.

When llvm-objcopy removes sections, it also removes sections that are
marked as associative to the removed section (as the associative
sections otherwise would end up orphaned).

In a linked executable module (EXE or DLL), section associativity is
meaningless - thus, we should ignore those fields from the input.

After linking, GNU ld keeps the SectionDefinition auxillary part of
symbols intact as it was in the source object file, which means that it
references section numbers in the source object files.

This fixes https://github.com/llvm/llvm-project/issues/53433.

(cherry picked from commit fcbbcffd2e6ea30097809ba0cd1e3b6003fa862f)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list