[PATCH] D49700: [LLD] [COFF] Treat .xdata/.pdata$<sym> as implicitly associative to <sym> for MinGW

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 23 15:02:46 PDT 2018


mstorsjo created this revision.
mstorsjo added reviewers: ruiu, rnk, pcc.
mstorsjo retitled this revision from "[COFF] Treat .xdata/.pdata$<sym> as implicitly associative to <sym> for MinGW" to "[LLD] [COFF] Treat .xdata/.pdata$<sym> as implicitly associative to <sym> for MinGW".

MinGW configurations don't use associative comdats, as GNU ld doesn't support that. Instead they produce normal comdats named .text$sym, .xdata$sym and .pdata$sym.

GNU ld doesn't discard any comdats starting with .xdata or .pdata, even if --gc-sections is used (while it does discard other unreferenced comdats), regardless of what symbol name is used after the $ separator.

For LLD, treat any such comdat as implicitly associative to the base symbol. This requires maintaining a map from symbol name to section number, but that is only maintained when the MinGW flag has been enabled.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49700

Files:
  COFF/InputFiles.cpp
  COFF/InputFiles.h
  test/COFF/Inputs/associative-comdat-mingw-2.s
  test/COFF/associative-comdat-mingw.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49700.156889.patch
Type: text/x-patch
Size: 6625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180723/e25a447b/attachment.bin>


More information about the llvm-commits mailing list