[PATCH] D36812: Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit

Jake Ehrlich via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 16:25:50 PDT 2017


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.

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.

On Mon, Oct 23, 2017 at 3:13 PM Roland McGrath <mcgrathr at google.com> wrote:

> GNU nm has the -s/--print-armap switch to dump the index.  You could
> implement that and then use it to test archive contents.
>
> On Mon, Oct 23, 2017 at 2:40 PM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>> Jake Ehrlich via Phabricator <reviews at reviews.llvm.org> writes:
>>
>> > Index: test/Object/archive-SYM64-write.test
>> > ===================================================================
>> > --- /dev/null
>> > +++ test/Object/archive-SYM64-write.test
>> > @@ -0,0 +1,27 @@
>> > +# RUN: yaml2obj %s > %t
>> > +# RUN: rm -f %t.lib
>> > +# RUN: llvm-ar cr %t.lib %t
>> > +# RUN: mv %t %t2
>> > +# RUN: llvm-ar cr %t.lib %t2 %p/Inputs/trivial-object-test.elf-x86-64
>> > +# RUN: llvm-nm %t.lib | FileCheck %s
>>
>> Why do you need to create the new library in two steps?
>>
>> As written the test would pass without the patch, no? The produced
>> symbol table would be broken, but we don't test that it is not.
>>
>> Not sure what is the best way to test that in llvm itself. All I can
>> think of is checking for /SYM64 or writing a unit test.
>>
>> Cheers,
>> Rafael
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171023/e3fcbc79/attachment.html>


More information about the llvm-commits mailing list