[llvm-dev] Embedding LLD version to executables

Rui Ueyama via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 25 15:23:51 PDT 2016


I'll rework on this after the linker-synthesized input section becomes a
thing. Currently I cannot easily append a string piece into an exiting
.comment section.

On Tue, Oct 25, 2016 at 3:07 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> I am ok with both ".note.linker-version" and adding an entry to .comment.
>
> I guess I have a small preference for .comment if this is a free format
> string.
>
> Cheers,
> Rafael
>
>
> On 18 October 2016 at 21:44, Rui Ueyama via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I'd like to make LLD embed version information so that we can determine
> if
> > an executable was created by LLD and if that's the case which version of
> > LLD.
> >
> > ld.bfd doesn't seem to embed any information, so we cannot tell whether
> an
> > executable was linked by ld.bfd or not easily.
> >
> > ld.gold embeds a string "GNU gold <version>" as ".note.gnu.gold-version"
> > section contents.
> >
> > I'm wondering what we should do for LLD. The gold's way seems almost
> right,
> > but I think we don't want to use the same section name because it
> contains
> > "gold" as part of the section name. However, at the same time, I don't
> > believe we want to create ".note.gnu.lld-version", because if we do, all
> > programs that determine linker version need to look at
> > ".note.gnu.<linker-name>-version" for all known linkers. That's absurd.
> > (Also, our product is not GNU, so ".gnu" part is probably irrelevant.)
> >
> > I'm leaning towards ".note.linker-version" in hope that other linkers
> follow
> > it.
> >
> > Any opinions?
> >
> > _______________________________________________
> > 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/20161025/1aaaddcb/attachment.html>


More information about the llvm-dev mailing list