Commit Graph

5 Commits

Author SHA1 Message Date
Frederic Riss eb85c8fb09 [dsymutil] Implement support for universal mach-o object files.
This patch allows llvm-dsymutil to read universal (aka fat) macho object
files and archives. The patch touches nearly everything in the BinaryHolder,
but it is fairly mechinical: the methods that returned MemoryBufferRefs or
ObjectFiles now return a vector of those, and the high-level access function
takes a triple argument to select the architecture.

There is no support yet for handling fat executables and thus no support for
writing fat object files.

llvm-svn: 243096
2015-07-24 06:41:11 +00:00
Frederic Riss 65f0abf275 [dsymutil] Make the triple detection more strict.
MachOObjectFile offers a method for detecting the correct triple, use
it instead of the previous approximation. This doesn't matter right
now, but it will become important for mach-o universal (fat) binaries.

llvm-svn: 243095
2015-07-24 06:41:04 +00:00
Frederic Riss 9388406c21 [dsymutil] Refactor BinaryHolder internals. NFC
Call a helper that resets all the internal state of the BinaryHolder
when we change the underlying memory buffer. Makes a followup patch
a tiny bit smaller.

llvm-svn: 243094
2015-07-24 06:40:59 +00:00
Frederic Riss 9ccfddc39d [dsymutil] Check archive members timestamps.
The debug map contains the timestamp of the object files in references.
We do not check these in the general case, but it's really useful if
you have archives where different versions of an object file have been
appended. This allows llvm-dsymutil to find the right one.

llvm-svn: 242965
2015-07-22 23:24:00 +00:00
Frederic Riss 4398850779 [dsymutil] Implement the BinaryHolder object and gain archive support.
This object is meant to own the ObjectFiles and their underlying
MemoryBuffer. It is basically the equivalent of an OwningBinary
except that it efficiently handles Archives. It is optimized for
efficiently providing mappings of members of the same archive when
they are opened successively (which is standard in Darwin debug
maps, objects from the same archive will be contiguous).

Of course, the BinaryHolder will also be used by the DWARF linker
once it is commited, but for now only the debug map parser uses it.

With this change, you can run llvm-dsymutil on your Darwin debug build
of clang and get a complete debug map for it.

Differential Revision: http://reviews.llvm.org/D6690

llvm-svn: 225207
2015-01-05 21:29:28 +00:00