<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Feb 1, 2018 at 4:30 PM, Rafael Avila de Espindola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Rui Ueyama via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> writes:<br>
<br>
</span><span class="">> ruiu updated this revision to Diff 132494.<br>
> ruiu added a comment.<br>
><br>
> - Add -r to produce a re-linkable object file.<br>
><br>
><br>
> <a href="https://reviews.llvm.org/D42823" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D42823</a><br>
><br>
> Files:<br>
>   lld/ELF/InputFiles.cpp<br>
>   lld/test/ELF/relocatable-<wbr>build-id.s<br>
><br>
><br>
> Index: lld/test/ELF/relocatable-<wbr>build-id.s<br>
> ==============================<wbr>==============================<wbr>=======<br>
> --- /dev/null<br>
> +++ lld/test/ELF/relocatable-<wbr>build-id.s<br>
> @@ -0,0 +1,12 @@<br>
> +# REQUIRES: x86<br>
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o<br>
> +# RUN: ld.lld --build-id=0xcafebabe -o %t2.o %t1.o -r<br>
<br>
</span>Should we add --build-id with -r? What is the usecase? Can you check<br>
what bfd and gold do?<br></blockquote><div><br></div><div>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.</div></div></div></div>