[PATCH] D89004: [LLD] [COFF] Implement a GNU/ELF like -wrap option

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 14:10:29 PDT 2020


mstorsjo created this revision.
mstorsjo added reviewers: rnk, ruiu.
Herald added subscribers: dang, dexonsmith, steven_wu, hiraditya.
Herald added a project: LLVM.
mstorsjo requested review of this revision.

Add a simple forwarding option in the MinGW frontend, and implement the private -wrap option in the COFF linker.

The feature in lld-link isn't gated by the -lldmingw option, but the option is left as a private, undocumented option primarily used by the MinGW driver.

The implementation is significantly based on the support for --wrap in the ELF linker, but many small nuance details are different between the ELF and COFF linkers, ending up with more than a few implementation differences.

This fixes https://bugs.llvm.org/show_bug.cgi?id=47384.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89004

Files:
  lld/COFF/Driver.cpp
  lld/COFF/InputFiles.h
  lld/COFF/LTO.cpp
  lld/COFF/MinGW.cpp
  lld/COFF/MinGW.h
  lld/COFF/Options.td
  lld/COFF/SymbolTable.cpp
  lld/COFF/Symbols.h
  lld/MinGW/Driver.cpp
  lld/MinGW/Options.td
  lld/test/COFF/wrap-i386.s
  lld/test/COFF/wrap-lto-1.ll
  lld/test/COFF/wrap-lto-2.ll
  lld/test/COFF/wrap-real-missing.s
  lld/test/COFF/wrap-with-archive.s
  lld/test/COFF/wrap.s
  lld/test/MinGW/driver.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89004.296786.patch
Type: text/x-patch
Size: 20630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201007/3a1956fb/attachment.bin>


More information about the llvm-commits mailing list