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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 10:58:25 PDT 2022


rnk added subscribers: aeubanks, MaskRay, hans.
rnk added a comment.

I think this is reasonable, but it's a big change worth discussing more widely. The basic idea is to try to make hidden visibility work on GNU COFF targets.

One major reservation that I have about this solution is that we've discovered that the .drective section is extremely inefficient. Consider that, with heavy use of templates, most C++ symbols are inline. Roughly speaking, O(all) strings in the symbol table will be duplicated into the .drectve section. C++ symbols, can in many cases, dominate symbol file size. This was a big problem for us in PGO builds, which use llvm.used, which uses the /include: directive. I think I filed a feature request to implement a more efficient scheme similar to the address-significance tables. This is a **much** more efficient way to tag symbols with some boolean property, and you can see it was discussed a few times recently with regard to the ELF address significance tables because it interacts with strip and objcopy in bad ways. However, I've never really seen those tools as part of the mainstream for COFF targets, so we kept the address significance protocol as it is.

I have never coordinated with binutils folks, and I think compatibility probably outweighs efficiency here, but if they are open to improvements, it's worth looking into this before we lock in this inefficient format.

Various interested parties: + at maskray @hans @aeubanks


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