diff options
author | Kevin Enderby <enderby@apple.com> | 2015-01-15 23:19:11 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2015-01-15 23:19:11 +0000 |
commit | 13023a1af6965374b0c253e8092cc36fbb46dcab (patch) | |
tree | 5e1b401f091d050b62116b111932a059146663a4 /llvm/lib/Object/Archive.cpp | |
parent | cb92c19fc4ac08a6e8e4806ce6f217d2e4f83b5c (diff) | |
download | bcm5719-llvm-13023a1af6965374b0c253e8092cc36fbb46dcab.tar.gz bcm5719-llvm-13023a1af6965374b0c253e8092cc36fbb46dcab.zip |
Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump.
llvm-svn: 226228
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 5aada91ecc0..ba35e49faa6 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -110,6 +110,12 @@ uint64_t Archive::Child::getSize() const { return Data.size() - StartOfFile; } +uint64_t Archive::Child::getRawSize() const { + if (Parent->IsThin) + return getHeader()->getSize(); + return Data.size(); +} + Archive::Child Archive::Child::getNext() const { size_t SpaceToSkip = Data.size(); // If it's odd, add 1 to make it even. @@ -125,6 +131,13 @@ Archive::Child Archive::Child::getNext() const { return Child(Parent, NextLoc); } +uint64_t Archive::Child::getChildOffset() const { + const char *a = Parent->Data.getBuffer().data(); + const char *c = Data.data(); + uint64_t offset = c - a; + return offset; +} + ErrorOr<StringRef> Archive::Child::getName() const { StringRef name = getRawName(); // Check if it's a special name. |