llvm.org GIT mirror llvm / 57cc8ad
Fix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers option and tweak its use in llvm-objdump. Add back the test case for the -archive-headers option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226332 91177308-0d34-0410-b5e6-96231b3b80d8 Kevin Enderby 5 years ago
4 changed file(s) with 13 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
9090 }
9191 /// \return the size of the archive member without the header or padding.
9292 uint64_t getSize() const;
93 /// \return the size of the archive member with the header and padding.
93 /// \return the size in the archive header for this member.
9494 uint64_t getRawSize() const;
9595
9696 StringRef getBuffer() const {
110110 }
111111
112112 uint64_t Archive::Child::getRawSize() const {
113 return Data.size();
113 return getHeader()->getSize();
114114 }
115115
116116 Archive::Child Archive::Child::getNext() const {
0 RUN: llvm-objdump %p/Inputs/macho-universal-archive.x86_64.i386 -macho -archive-headers -arch all \
1 RUN: | FileCheck %s
2
3 # Note the date as printed by ctime(3) is time zone dependent and not checked.
4 CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture x86_64)
5 CHECK: -rw-r--r--124/11 44 {{.*}} __.SYMDEF SORTED
6 CHECK: -rw-r--r--124/0 860 {{.*}} hello.o
7 CHECK: Archive : {{.*}}/macho-universal-archive.x86_64.i386 (architecture i386)
8 CHECK: -rw-r--r--124/11 60 {{.*}} __.SYMDEF SORTED
9 CHECK: -rw-r--r--124/0 388 {{.*}} foo.o
571571 outs() << format("%3d/", UID);
572572 unsigned GID = C.getGID();
573573 outs() << format("%-3d ", GID);
574 uint64_t Size = C.getRawSize() - sizeof(object::ArchiveMemberHeader);
574 uint64_t Size = C.getRawSize();
575575 outs() << format("%5d ", Size);
576576
577577 StringRef RawLastModified = C.getRawLastModified();