[all-commits] [llvm/llvm-project] a311bc: [llvm-dlltool] Implement the --identify option (#1...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Mar 25 16:35:46 PDT 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: a311bc81d957c74739f39889329d13161673a696
      https://github.com/llvm/llvm-project/commit/a311bc81d957c74739f39889329d13161673a696
  Author: Martin Storsjö <martin at martin.st>
  Date:   2025-03-25 (Tue, 25 Mar 2025)

  Changed paths:
    M llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
    M llvm/lib/ToolDrivers/llvm-dlltool/Options.td
    A llvm/test/tools/llvm-dlltool/Inputs/gnu_foo_lib_h.yaml
    A llvm/test/tools/llvm-dlltool/Inputs/gnu_foo_lib_s00000.yaml
    A llvm/test/tools/llvm-dlltool/Inputs/gnu_foo_lib_t.yaml
    A llvm/test/tools/llvm-dlltool/Inputs/llvm_foo_dll_1.yaml
    A llvm/test/tools/llvm-dlltool/Inputs/llvm_foo_dll_2.yaml
    A llvm/test/tools/llvm-dlltool/Inputs/llvm_foo_dll_3.yaml
    A llvm/test/tools/llvm-dlltool/identify.test

  Log Message:
  -----------
  [llvm-dlltool] Implement the --identify option (#127465)

This option prints the name of the DLL that gets imported, when linking
against an import library.

This is implemented using the same strategy as GNU dlltool does; looking
for the contents of .idata$6 or .idata$7 chunks. The right section name
to check for is chosen by identifying whether the library is GNU or LLVM
style. In the case of GNU import libraries, the DLL name is in an
.idata$7 chunk. However there are also other chunks with that section
name (for entries for the IAT or ILT); identify these by looking for
whether a chunk contains relocations.

Alternatively, one could also just look for .idata$2 chunks, look for
relocations at the right offset, and locate data at the symbol that the
relocation points at (which may be in the same or in another object
file).

(cherry picked from commit dcc08a17c781a5066ab17b9791e1c455f7cedbf7)


  Commit: f7b6f23c6bb7a1276b8de569014672b7d29c2b7e
      https://github.com/llvm/llvm-project/commit/f7b6f23c6bb7a1276b8de569014672b7d29c2b7e
  Author: Martin Storsjö <martin at martin.st>
  Date:   2025-03-25 (Tue, 25 Mar 2025)

  Changed paths:
    M llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt

  Log Message:
  -----------
  [llvm-dlltool] Add a missing dependency

This was missed in dcc08a17c781a5066ab17b9791e1c455f7cedbf7.

(cherry picked from commit 1ca93b15482d3bfa1560b35960ab46fea65b3074)


Compare: https://github.com/llvm/llvm-project/compare/6034661369c4...f7b6f23c6bb7

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