[PATCH] D42823: Strip .note.gnu.build-id sections if --build-id is given.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 16:32:51 PST 2018


On Thu, Feb 1, 2018 at 4:30 PM, Rafael Avila de Espindola <
rafael.espindola at gmail.com> wrote:

> Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:
>
> > ruiu updated this revision to Diff 132494.
> > ruiu added a comment.
> >
> > - Add -r to produce a re-linkable object file.
> >
> >
> > https://reviews.llvm.org/D42823
> >
> > Files:
> >   lld/ELF/InputFiles.cpp
> >   lld/test/ELF/relocatable-build-id.s
> >
> >
> > Index: lld/test/ELF/relocatable-build-id.s
> > ===================================================================
> > --- /dev/null
> > +++ lld/test/ELF/relocatable-build-id.s
> > @@ -0,0 +1,12 @@
> > +# REQUIRES: x86
> > +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o
> > +# RUN: ld.lld --build-id=0xcafebabe -o %t2.o %t1.o -r
>
> Should we add --build-id with -r? What is the usecase? Can you check
> what bfd and gold do?
>

According to Ian, gold seems to add .note.gnu.build-id to object files if
-r and --build-id are used at the same time. I don't actually know what is
the valid use case of adding a .build-id to an object file, but that's
doable, and I think we need to protect ourselves from such inputs.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180201/fbaed540/attachment.html>


More information about the llvm-commits mailing list