Joerg Sonnenberger via llvm-dev
2016-Oct-26 11:16 UTC
[llvm-dev] Embedding LLD version to executables
On Tue, Oct 25, 2016 at 06:07:09PM -0400, Rafael Espíndola via llvm-dev wrote:> I am ok with both ".note.linker-version" and adding an entry to .comment.There is one important different between the two -- strip normally has to preserve the former, but not the latter. As such, I'd quite a bit prefer using .comment. Joerg
Sean Silva via llvm-dev
2016-Oct-29 07:50 UTC
[llvm-dev] Embedding LLD version to executables
On Wed, Oct 26, 2016 at 4:16 AM, Joerg Sonnenberger via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Tue, Oct 25, 2016 at 06:07:09PM -0400, Rafael Espíndola via llvm-dev > wrote: > > I am ok with both ".note.linker-version" and adding an entry to .comment. > > There is one important different between the two -- strip normally has > to preserve the former, but not the latter. As such, I'd quite a bit > prefer using .comment. >+1 for .comment; we should be consistent with how clang handles .ident, since this is conceptually the same information. In fact, during LTO, LLD should probably add an ident entry to any module that it codegens to indicate that it was codegenerated through LLD; but that's a separate discussion. -- Sean Silva> > Joerg > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161029/2e6da8a3/attachment.html>
Rui Ueyama via llvm-dev
2016-Nov-11 22:40 UTC
[llvm-dev] Embedding LLD version to executables
For the record, this feature is implemented in r286496 ( https://reviews.llvm.org/D26487). Now the LLD version string is embedded to output's .comment section. You can use objdump to see it. $ objdump -s -j .comment foo foo: file format elf64-x86-64 Contents of section .comment: 0000 00474343 3a202855 62756e74 7520342e .GCC: (Ubuntu 4. 0010 382e342d 32756275 6e747531 7e31342e 8.4-2ubuntu1~14. ... 00c0 766d2f74 72756e6b 20323835 38343629 vm/trunk 285846) 00d0 004c696e 6b65723a 204c4c44 20342e30 .Linker: LLD 4.0 00e0 2e302028 7472756e 6b203238 36343036 .0 (trunk 286406 00f0 2900 ). On Sat, Oct 29, 2016 at 12:50 AM, Sean Silva via llvm-dev < llvm-dev at lists.llvm.org> wrote:> > > On Wed, Oct 26, 2016 at 4:16 AM, Joerg Sonnenberger via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> On Tue, Oct 25, 2016 at 06:07:09PM -0400, Rafael Espíndola via llvm-dev >> wrote: >> > I am ok with both ".note.linker-version" and adding an entry to >> .comment. >> >> There is one important different between the two -- strip normally has >> to preserve the former, but not the latter. As such, I'd quite a bit >> prefer using .comment. >> > > +1 for .comment; we should be consistent with how clang handles .ident, > since this is conceptually the same information. > > In fact, during LTO, LLD should probably add an ident entry to any module > that it codegens to indicate that it was codegenerated through LLD; but > that's a separate discussion. > > -- Sean Silva > > >> >> Joerg >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161111/d29a4719/attachment.html>