[PATCH] D54487: Implement llvm.commandline named metadata

John Reagan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 09:17:07 PST 2018


JohnReagan added a comment.

In https://reviews.llvm.org/D54487#1297507, @scott.linder wrote:

> In https://reviews.llvm.org/D54487#1297461, @JohnReagan wrote:
>
> > I know you are just trying to match gcc behavior, but do you know why they use SHT_PROGBITS instead of something like SHT_NOTE for the information?  On OpenVMS, we use .note entries to record compilation date/time, compiler version, command line, etc. information that is later used by our linker to print out detail link maps.  Or is the intention that the information get propagated all the way to the final executable or shared library?
>
>
> I don't have a good answer as to why GCC decided to use SHT_PROGBITS, and you're correct that I simply followed their lead. I think SHT_NOTE seems more appropriate, although at AMD we do want to propagate the section to the final executable/shared object; are the two incompatible? It seems fine if tools like strip remove the section.


Got it.   Yes, SHT_NOTEs probably don't survive into the final image so SHT_PROGBITS is what was chosen.  I wonder if the linker special cases on the section name to keep it from being part of a load section?  Seems like a waste to read that stuff into memory at image activation time.


Repository:
  rL LLVM

https://reviews.llvm.org/D54487





More information about the llvm-commits mailing list