<div dir="ltr">I produced the binary in two steps so that I could save on copying file. I'm find producing it in one step if you want it just means duplicating a 2 GB file. It would be nice if yaml2obj used a sparse file but at the moment it doesn't.<br><br>I didn't realize that llvm-nm didn't get the map. It appears that llvm-nm --print-armap is already implemented. When I try that this test fails saying that the archive is malformed. I'm looking into what I did incorrectly.</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 23, 2017 at 3:13 PM Roland McGrath <<a href="mailto:mcgrathr@google.com">mcgrathr@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">GNU nm has the -s/--print-armap switch to dump the index.  You could implement that and then use it to test archive contents.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 23, 2017 at 2:40 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>Jake Ehrlich via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> writes:<br>
<br>
> Index: test/Object/archive-SYM64-write.test<br>
> ===================================================================<br>
> --- /dev/null<br>
> +++ test/Object/archive-SYM64-write.test<br>
> @@ -0,0 +1,27 @@<br>
> +# RUN: yaml2obj %s > %t<br>
> +# RUN: rm -f %t.lib<br>
> +# RUN: llvm-ar cr %t.lib %t<br>
> +# RUN: mv %t %t2<br>
> +# RUN: llvm-ar cr %t.lib %t2 %p/Inputs/trivial-object-test.elf-x86-64<br>
</span>> +# RUN: llvm-nm %t.lib | FileCheck %s<br>
<br>
Why do you need to create the new library in two steps?<br>
<br>
As written the test would pass without the patch, no? The produced<br>
symbol table would be broken, but we don't test that it is not.<br>
<br>
Not sure what is the best way to test that in llvm itself. All I can<br>
think of is checking for /SYM64 or writing a unit test.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote></div><br></div>
</blockquote></div>