[llvm] r371515 - [Object] Implement relocation resolver for COFF ARM/ARM64
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 10 05:31:41 PDT 2019
Author: mstorsjo
Date: Tue Sep 10 05:31:40 2019
New Revision: 371515
URL: http://llvm.org/viewvc/llvm-project?rev=371515&view=rev
Log:
[Object] Implement relocation resolver for COFF ARM/ARM64
Adding testscases for this via llvm-dwarfdump.
Also add testcases for the existing resolver support for X86.
Differential Revision: https://reviews.llvm.org/D67340
Added:
llvm/trunk/test/tools/llvm-dwarfdump/coff-arm.yaml
llvm/trunk/test/tools/llvm-dwarfdump/coff-arm64.yaml
llvm/trunk/test/tools/llvm-dwarfdump/coff-i386.yaml
llvm/trunk/test/tools/llvm-dwarfdump/coff-x86_64.yaml
Modified:
llvm/trunk/lib/Object/RelocationResolver.cpp
Modified: llvm/trunk/lib/Object/RelocationResolver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/RelocationResolver.cpp?rev=371515&r1=371514&r2=371515&view=diff
==============================================================================
--- llvm/trunk/lib/Object/RelocationResolver.cpp (original)
+++ llvm/trunk/lib/Object/RelocationResolver.cpp Tue Sep 10 05:31:40 2019
@@ -426,6 +426,47 @@ static uint64_t resolveCOFFX86_64(Reloca
}
}
+static bool supportsCOFFARM(uint64_t Type) {
+ switch (Type) {
+ case COFF::IMAGE_REL_ARM_SECREL:
+ case COFF::IMAGE_REL_ARM_ADDR32:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static uint64_t resolveCOFFARM(RelocationRef R, uint64_t S, uint64_t A) {
+ switch (R.getType()) {
+ case COFF::IMAGE_REL_ARM_SECREL:
+ case COFF::IMAGE_REL_ARM_ADDR32:
+ return (S + A) & 0xFFFFFFFF;
+ default:
+ llvm_unreachable("Invalid relocation type");
+ }
+}
+
+static bool supportsCOFFARM64(uint64_t Type) {
+ switch (Type) {
+ case COFF::IMAGE_REL_ARM64_SECREL:
+ case COFF::IMAGE_REL_ARM64_ADDR64:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static uint64_t resolveCOFFARM64(RelocationRef R, uint64_t S, uint64_t A) {
+ switch (R.getType()) {
+ case COFF::IMAGE_REL_ARM64_SECREL:
+ return (S + A) & 0xFFFFFFFF;
+ case COFF::IMAGE_REL_ARM64_ADDR64:
+ return S + A;
+ default:
+ llvm_unreachable("Invalid relocation type");
+ }
+}
+
static bool supportsMachOX86_64(uint64_t Type) {
return Type == MachO::X86_64_RELOC_UNSIGNED;
}
@@ -478,9 +519,19 @@ static uint64_t resolveWasm32(Relocation
std::pair<bool (*)(uint64_t), RelocationResolver>
getRelocationResolver(const ObjectFile &Obj) {
if (Obj.isCOFF()) {
- if (Obj.getBytesInAddress() == 8)
+ switch (Obj.getArch()) {
+ case Triple::x86_64:
return {supportsCOFFX86_64, resolveCOFFX86_64};
- return {supportsCOFFX86, resolveCOFFX86};
+ case Triple::x86:
+ return {supportsCOFFX86, resolveCOFFX86};
+ case Triple::arm:
+ case Triple::thumb:
+ return {supportsCOFFARM, resolveCOFFARM};
+ case Triple::aarch64:
+ return {supportsCOFFARM64, resolveCOFFARM64};
+ default:
+ return {nullptr, nullptr};
+ }
} else if (Obj.isELF()) {
if (Obj.getBytesInAddress() == 8) {
switch (Obj.getArch()) {
Added: llvm/trunk/test/tools/llvm-dwarfdump/coff-arm.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/coff-arm.yaml?rev=371515&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/coff-arm.yaml (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/coff-arm.yaml Tue Sep 10 05:31:40 2019
@@ -0,0 +1,141 @@
+# RUN: yaml2obj %s | llvm-dwarfdump - | FileCheck %s
+# CHECK: DW_TAG_compile_unit
+# CHECK-NEXT: DW_AT_producer ("producer string")
+# CHECK-NEXT: DW_AT_language (DW_LANG_C99)
+# CHECK-NEXT: DW_AT_name ("test.c")
+# CHECK-NEXT: DW_AT_comp_dir ("/path/to/src")
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_ARMNT
+ Characteristics: [ ]
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_PURGEABLE, IMAGE_SCN_MEM_16BIT, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .data
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .bss
+ Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ SizeOfRawData: 0
+ - Name: .debug_str
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 70726F647563657220737472696E6700746573742E63002F706174682F746F2F73726300
+ - Name: .debug_abbrev
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 011101250E1305030E1B0E000000
+ - Name: .debug_info
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 170000000400000000000401000000000C00000000000000000000
+ Relocations:
+ - VirtualAddress: 6
+ SymbolName: .debug_abbrev
+ Type: IMAGE_REL_ARM_SECREL
+ - VirtualAddress: 12
+ SymbolName: info_string0
+ Type: IMAGE_REL_ARM_SECREL
+ - VirtualAddress: 18
+ SymbolName: info_string1
+ Type: IMAGE_REL_ARM_SECREL
+ - VirtualAddress: 22
+ SymbolName: info_string2
+ Type: IMAGE_REL_ARM_SECREL
+symbols:
+ - Name: .text
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 1
+ - Name: .data
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 2
+ - Name: .bss
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 3
+ - Name: .debug_str
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 36
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3440120581
+ Number: 4
+ - Name: .debug_abbrev
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 14
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 2811829245
+ Number: 5
+ - Name: .debug_info
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 27
+ NumberOfRelocations: 4
+ NumberOfLinenumbers: 0
+ CheckSum: 1535600857
+ Number: 6
+ - Name: info_string0
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string1
+ Value: 16
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string2
+ Value: 23
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+...
Added: llvm/trunk/test/tools/llvm-dwarfdump/coff-arm64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/coff-arm64.yaml?rev=371515&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/coff-arm64.yaml (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/coff-arm64.yaml Tue Sep 10 05:31:40 2019
@@ -0,0 +1,141 @@
+# RUN: yaml2obj %s | llvm-dwarfdump - | FileCheck %s
+# CHECK: DW_TAG_compile_unit
+# CHECK-NEXT: DW_AT_producer ("producer string")
+# CHECK-NEXT: DW_AT_language (DW_LANG_C99)
+# CHECK-NEXT: DW_AT_name ("test.c")
+# CHECK-NEXT: DW_AT_comp_dir ("/path/to/src")
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_ARM64
+ Characteristics: [ ]
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .data
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .bss
+ Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ SizeOfRawData: 0
+ - Name: .debug_str
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 70726F647563657220737472696E6700746573742E63002F706174682F746F2F73726300
+ - Name: .debug_abbrev
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 011101250E1305030E1B0E000000
+ - Name: .debug_info
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 170000000400000000000401000000000C00000000000000000000
+ Relocations:
+ - VirtualAddress: 6
+ SymbolName: .debug_abbrev
+ Type: IMAGE_REL_ARM64_SECREL
+ - VirtualAddress: 12
+ SymbolName: info_string0
+ Type: IMAGE_REL_ARM64_SECREL
+ - VirtualAddress: 18
+ SymbolName: info_string1
+ Type: IMAGE_REL_ARM64_SECREL
+ - VirtualAddress: 22
+ SymbolName: info_string2
+ Type: IMAGE_REL_ARM64_SECREL
+symbols:
+ - Name: .text
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 1
+ - Name: .data
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 2
+ - Name: .bss
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 3
+ - Name: .debug_str
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 36
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3440120581
+ Number: 4
+ - Name: .debug_abbrev
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 14
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 2811829245
+ Number: 5
+ - Name: .debug_info
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 27
+ NumberOfRelocations: 4
+ NumberOfLinenumbers: 0
+ CheckSum: 1535600857
+ Number: 6
+ - Name: info_string0
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string1
+ Value: 16
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string2
+ Value: 23
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+...
Added: llvm/trunk/test/tools/llvm-dwarfdump/coff-i386.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/coff-i386.yaml?rev=371515&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/coff-i386.yaml (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/coff-i386.yaml Tue Sep 10 05:31:40 2019
@@ -0,0 +1,171 @@
+# RUN: yaml2obj %s | llvm-dwarfdump - | FileCheck %s
+# CHECK: DW_TAG_compile_unit
+# CHECK-NEXT: DW_AT_producer ("producer string")
+# CHECK-NEXT: DW_AT_language (DW_LANG_C99)
+# CHECK-NEXT: DW_AT_name ("test.c")
+# CHECK-NEXT: DW_AT_comp_dir ("/path/to/src")
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_I386
+ Characteristics: [ ]
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .data
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .bss
+ Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ SizeOfRawData: 0
+ - Name: .debug_str
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 70726F647563657220737472696E6700746573742E63002F706174682F746F2F73726300
+ - Name: .debug_abbrev
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 011101250E1305030E1B0E000000
+ - Name: .debug_info
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 170000000400000000000401000000000C00000000000000000000
+ Relocations:
+ - VirtualAddress: 6
+ SymbolName: .Lsection_abbrev
+ Type: IMAGE_REL_I386_SECREL
+ - VirtualAddress: 12
+ SymbolName: info_string0
+ Type: IMAGE_REL_I386_SECREL
+ - VirtualAddress: 18
+ SymbolName: info_string1
+ Type: IMAGE_REL_I386_SECREL
+ - VirtualAddress: 22
+ SymbolName: info_string2
+ Type: IMAGE_REL_I386_SECREL
+symbols:
+ - Name: .text
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 1
+ - Name: .data
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 2
+ - Name: .bss
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 3
+ - Name: .debug_str
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 36
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3440120581
+ Number: 4
+ - Name: .debug_abbrev
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 14
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 2811829245
+ Number: 5
+ - Name: .debug_info
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 27
+ NumberOfRelocations: 4
+ NumberOfLinenumbers: 0
+ CheckSum: 1535600857
+ Number: 6
+ - Name: info_string0
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string1
+ Value: 16
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string2
+ Value: 23
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: .Lsection_abbrev
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: .Lsection_info
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: .Lcu_begin0
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: .Ldebug_info_end0
+ Value: 27
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: .Ldebug_info_start0
+ Value: 4
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+...
Added: llvm/trunk/test/tools/llvm-dwarfdump/coff-x86_64.yaml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/coff-x86_64.yaml?rev=371515&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/coff-x86_64.yaml (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/coff-x86_64.yaml Tue Sep 10 05:31:40 2019
@@ -0,0 +1,141 @@
+# RUN: yaml2obj %s | llvm-dwarfdump - | FileCheck %s
+# CHECK: DW_TAG_compile_unit
+# CHECK-NEXT: DW_AT_producer ("producer string")
+# CHECK-NEXT: DW_AT_language (DW_LANG_C99)
+# CHECK-NEXT: DW_AT_name ("test.c")
+# CHECK-NEXT: DW_AT_comp_dir ("/path/to/src")
+--- !COFF
+header:
+ Machine: IMAGE_FILE_MACHINE_AMD64
+ Characteristics: [ ]
+sections:
+ - Name: .text
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .data
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ - Name: .bss
+ Characteristics: [ IMAGE_SCN_CNT_UNINITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 4
+ SectionData: ''
+ SizeOfRawData: 0
+ - Name: .debug_str
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 70726F647563657220737472696E6700746573742E63002F706174682F746F2F73726300
+ - Name: .debug_abbrev
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 011101250E1305030E1B0E000000
+ - Name: .debug_info
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
+ Alignment: 1
+ SectionData: 170000000400000000000401000000000C00000000000000000000
+ Relocations:
+ - VirtualAddress: 6
+ SymbolName: .debug_abbrev
+ Type: IMAGE_REL_AMD64_SECREL
+ - VirtualAddress: 12
+ SymbolName: info_string0
+ Type: IMAGE_REL_AMD64_SECREL
+ - VirtualAddress: 18
+ SymbolName: info_string1
+ Type: IMAGE_REL_AMD64_SECREL
+ - VirtualAddress: 22
+ SymbolName: info_string2
+ Type: IMAGE_REL_AMD64_SECREL
+symbols:
+ - Name: .text
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 1
+ - Name: .data
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 2
+ - Name: .bss
+ Value: 0
+ SectionNumber: 3
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 3
+ - Name: .debug_str
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 36
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 3440120581
+ Number: 4
+ - Name: .debug_abbrev
+ Value: 0
+ SectionNumber: 5
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 14
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 2811829245
+ Number: 5
+ - Name: .debug_info
+ Value: 0
+ SectionNumber: 6
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 27
+ NumberOfRelocations: 4
+ NumberOfLinenumbers: 0
+ CheckSum: 1535600857
+ Number: 6
+ - Name: info_string0
+ Value: 0
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string1
+ Value: 16
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ - Name: info_string2
+ Value: 23
+ SectionNumber: 4
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+...
More information about the llvm-commits
mailing list