[all-commits] [llvm/llvm-project] adcdc9: [LLD][COFF] Allow overwriting directives exports w...

Alexandre Ganea via All-commits all-commits at lists.llvm.org
Tue Jun 13 12:30:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adcdc9cc3740adba3577b328fa3ba492cbccd3a5
      https://github.com/llvm/llvm-project/commit/adcdc9cc3740adba3577b328fa3ba492cbccd3a5
  Author: Alexandre Ganea <alex_toresh at yahoo.fr>
  Date:   2023-06-13 (Tue, 13 Jun 2023)

  Changed paths:
    M lld/COFF/Config.h
    M lld/COFF/DLL.cpp
    M lld/COFF/Driver.cpp
    M lld/COFF/DriverUtils.cpp
    M lld/test/COFF/export.test
    M lld/test/COFF/export32.test
    A lld/test/COFF/ordinals-override.test

  Log Message:
  -----------
  [LLD][COFF] Allow overwriting directives exports with cmd-line exports

MSVC link.exe allows overriding exports on the cmd-line with exports seen in OBJ directives. The typical case is what is described in #62329.

Before this patch, trying to override an export with `/export` or `/def` would generate a duplicate warning. This patches tries to replicate the MSVC behavior. A second override on the cmd-line would still generate the warning.

There's still a case which we don't cover: MSVC link.exe is able to demangle an exported OBJ directive function, and match it with a unmangled export function in a .def file. In the meanwhile, one can use the mangled export in the .def to cover that case.

This fixes #62329

Differential revision: https://reviews.llvm.org/D149611




More information about the All-commits mailing list