[PATCH] D130121: [3/3] [COFF] Emit embedded -exclude-symbols: directives for hidden visibility for MinGW

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 05:59:19 PDT 2022


mstorsjo marked an inline comment as done.
mstorsjo added inline comments.


================
Comment at: llvm/lib/IR/Mangler.cpp:248
+    OS << " -exclude-symbols:";
+
+    bool NeedQuotes = GV->hasName() && !canBeUnquotedInDirective(GV->getName());
----------------
MaskRay wrote:
> Is it useful to encode several symbols joined by `,` with one `-exclude-symbols:`? Just to make the section content smaller.
Yes, that would be useful given that the option does support multiple symbols per directive (contrary to `-export`). But I think that would require some amount of extra refactoring, because `emitLinkerFlagsForGlobalCOFF` is called with one `GlobalValue` at a time, and it is called from at least 3 different locations.


================
Comment at: llvm/test/CodeGen/X86/mingw-hidden.ll:72
+; CHECK-MINGW: .section .drectve
+; CHECK-MINGW: .ascii " -exclude-symbols:f1"
+; CHECK-MINGW: .ascii " -exclude-symbols:f2"
----------------
MaskRay wrote:
> -SAME
I don't see how `-SAME` would help anything here? All the `.section .drectve` and all the `.ascii` lines are on separate lines in the output.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130121/new/

https://reviews.llvm.org/D130121



More information about the llvm-commits mailing list