From 13023a1af6965374b0c253e8092cc36fbb46dcab Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Thu, 15 Jan 2015 23:19:11 +0000 Subject: Add the option, -archive-headers, used with -macho to print the Mach-O archive headers to llvm-objdump. llvm-svn: 226228 --- llvm/lib/Object/Archive.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/lib/Object/Archive.cpp') 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 Archive::Child::getName() const { StringRef name = getRawName(); // Check if it's a special name. -- cgit v1.2.3