[all-commits] [llvm/llvm-project] df0819: [LLD] [COFF] Fix crashes for conflicting exports w...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Apr 7 00:58:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df081924cf21d3b289f976172f6583cc63ec40fb
      https://github.com/llvm/llvm-project/commit/df081924cf21d3b289f976172f6583cc63ec40fb
  Author: Martin Storsjö <martin at martin.st>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    M lld/COFF/Config.h
    M lld/COFF/Driver.cpp
    M lld/COFF/SymbolTable.cpp
    A lld/test/COFF/export-all-conflict.test

  Log Message:
  -----------
  [LLD] [COFF] Fix crashes for conflicting exports with -export-all-symbols (#190492)

Commit adcdc9cc3740adba3577b328fa3ba492cbccd3a5 (since LLD 17) added a
warning message if there are conflicting attempts to export a specific
symbol.

That commit missed one source of exports, from the LLD specific
-export-all-symbols flag (which only has an effect in mingw mode).

To trigger this case, one needs to have an export set by a def file,
combined with the -export-all-symbols flag (which attempts to export all
global symbols, despite explicit exports through embedded directives or
a def file).

To trigger the warning (and the previous crash), one would have to have
some difference between the export produced by -export-all-symbols and
the one from the def file. That difference could be e.g. that the def
file contained an explicit ordinal, or that the def file lacked a DATA
marking for a symbol that the automatic export of all symbols decides to
export as a data symbol.

This fixes https://github.com/llvm/llvm-project/issues/187318. (In the
repro case in that bug, the def file lacked DATA markings for a data
symbol.)



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