[llvm] r306795 - [llvm-readobj] Improve printouts for COFF ARM64 binaries
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 30 00:02:13 PDT 2017
Author: mstorsjo
Date: Fri Jun 30 00:02:13 2017
New Revision: 306795
URL: http://llvm.org/viewvc/llvm-project?rev=306795&view=rev
Log:
[llvm-readobj] Improve printouts for COFF ARM64 binaries
Differential Revision: https://reviews.llvm.org/D34835
Added:
llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm64
Modified:
llvm/trunk/lib/Object/COFFObjectFile.cpp
llvm/trunk/test/tools/llvm-readobj/file-headers.test
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=306795&r1=306794&r2=306795&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Fri Jun 30 00:02:13 2017
@@ -883,7 +883,7 @@ base_reloc_iterator COFFObjectFile::base
}
uint8_t COFFObjectFile::getBytesInAddress() const {
- return getArch() == Triple::x86_64 ? 8 : 4;
+ return getArch() == Triple::x86_64 || getArch() == Triple::aarch64 ? 8 : 4;
}
StringRef COFFObjectFile::getFileFormatName() const {
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm64?rev=306795&view=auto
==============================================================================
Binary files llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm64 (added) and llvm/trunk/test/tools/llvm-readobj/Inputs/trivial.obj.coff-arm64 Fri Jun 30 00:02:13 2017 differ
Modified: llvm/trunk/test/tools/llvm-readobj/file-headers.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/file-headers.test?rev=306795&r1=306794&r2=306795&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/file-headers.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/file-headers.test Fri Jun 30 00:02:13 2017
@@ -1,5 +1,7 @@
RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-arm \
RUN: | FileCheck %s -check-prefix COFF-ARM
+RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-arm64 \
+RUN: | FileCheck %s -check-prefix COFF-ARM64
RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-i386 \
RUN: | FileCheck %s -check-prefix COFF32
RUN: llvm-readobj -h %p/Inputs/trivial.obj.coff-x86-64 \
@@ -47,6 +49,21 @@ COFF-ARM-NEXT: Characteristics [ (0x0)
COFF-ARM-NEXT: ]
COFF-ARM-NEXT: }
+COFF-ARM64: File: {{(.*[/\\])?}}trivial.obj.coff-arm64
+COFF-ARM64-NEXT: Format: COFF-ARM64
+COFF-ARM64-NEXT: Arch: aarch64
+COFF-ARM64-NEXT: AddressSize: 64bit
+COFF-ARM64-NEXT: ImageFileHeader {
+COFF-ARM64-NEXT: Machine: IMAGE_FILE_MACHINE_ARM64 (0xAA64)
+COFF-ARM64-NEXT: SectionCount: 1
+COFF-ARM64-NEXT: TimeDateStamp: 1970-01-01 00:00:00 (0x0)
+COFF-ARM64-NEXT: PointerToSymbolTable: 0x44
+COFF-ARM64-NEXT: SymbolCount: 3
+COFF-ARM64-NEXT: OptionalHeaderSize: 0
+COFF-ARM64-NEXT: Characteristics [ (0x0)
+COFF-ARM64-NEXT: ]
+COFF-ARM64-NEXT: }
+
COFF32: File: {{(.*[/\\])?}}trivial.obj.coff-i386
COFF32-NEXT: Format: COFF-i386
COFF32-NEXT: Arch: i386
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=306795&r1=306794&r2=306795&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Fri Jun 30 00:02:13 2017
@@ -335,6 +335,7 @@ static const EnumEntry<COFF::MachineType
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_AM33 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_AMD64 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARM ),
+ LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARM64 ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_ARMNT ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_EBC ),
LLVM_READOBJ_ENUM_ENT(COFF, IMAGE_FILE_MACHINE_I386 ),
More information about the llvm-commits
mailing list