[PATCH] [lld] Add ArchiveMemoryBuffer.

Shankar Kalpathi Easwaran shankarke at gmail.com
Thu Feb 5 04:58:17 PST 2015

The input section descripton can contain a file pattern that need to be matched.

Some trivial examples are :-

.text.libcprintf : { libc.a:printf.o (*.text) } 
.text.alllibc : { libc.a: *(*.text*) }

The first one selects text from only printf.o of libc.a (only if libc.a is an archive) and places that in the output section .text.libcprintf.

Please see https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html#Input-Section-Basics for more detailed information on other wildcards.

You are right that File has to know about this memberName and FileName separation. I tried to do this by adding another parameter to the File constructor but the solution looked very ugly, The path that lld::File returns is the BufferIdentifier stored in the MemoryBuffer. Adding another parameter to all the places where a File is constructed is a overkill since this is only needed for Archive members.

As I mentioned this in the description, the next patch would be for File to own the MemoryBuffer and return the path or member information directly using MemoryBuffer.

We discussed this on llvmdev sometime late last year too : http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-December/079295.html



More information about the llvm-commits mailing list