[all-commits] [llvm/llvm-project] 503bc5: [LLD] [COFF] Fix handling of comdat .drectve secti...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Wed Oct 4 00:55:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 503bc5f66111f7e4fc79972bb9bfec8bb5606bab
      https://github.com/llvm/llvm-project/commit/503bc5f66111f7e4fc79972bb9bfec8bb5606bab
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M lld/COFF/InputFiles.cpp
    A lld/test/COFF/comdat-drectve.s

  Log Message:
  -----------
  [LLD] [COFF] Fix handling of comdat .drectve sections (#68116)

This can happen when manually emitting strings into .drectve sections
with `__attribute__((section(".drectve")))`, which is a way to emulate
`#pragma comment(linker, "...")` for mingw compilers, without requiring
building with -fms-extensions.

Normally, this doesn't generate any comdat, but if compiled with
-fsanitize=address, this section does get turned into a comdat section.

This fixes #67261. This issue can be seen as a regression; a change in
the "lli" tool in 17.x triggers this case, if compiled with ASAN
enabled, triggering this unsupported corner case in LLD. With this
change, LLD can handle it.




More information about the All-commits mailing list