llvm-project
62 строки · 2.4 Кб
1# REQUIRES: x86
2
3# RUN: yaml2obj %s -o %t.o
4
5# Test that we get both the resource and the code from a single object
6# file that contains both, while merging resources from another object
7# file.
8
9# RUN: lld-link -lldmingw -out:%t.exe %t.o %p/Inputs/id.res.o -entry:main
10# RUN: llvm-readobj --coff-resources %t.exe | FileCheck %s --check-prefix=CHECK-RESOURCES
11# RUN: llvm-objdump --no-print-imm-hex -d %t.exe | FileCheck %s --check-prefix=CHECK-DISASM
12
13# CHECK-RESOURCES: Resources [
14# CHECK-RESOURCES-NEXT: Total Number of Resources: 2
15
16# CHECK-DISASM: <.text>:
17# CHECK-DISASM-NEXT: movl $42, %eax
18# CHECK-DISASM-NEXT: retq
19
20--- !COFF
21header:
22Machine: IMAGE_FILE_MACHINE_AMD64
23Characteristics: [ IMAGE_FILE_LINE_NUMS_STRIPPED ]
24sections:
25- Name: .rsrc
26Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
27Alignment: 4
28SectionData: 0000000000000000000000000000010005000000180000800000000000000000000000000100000048000080300000800000000000000000000000000000010009040000600000000A0054004500530054004400490041004C004F0047000000700000006C00000000000000000000000000C0800000000002000A000A00C8002C01000000005400650073007400000001000250000000000A000A00E6000E000100FFFF820043006F006E00740069006E00750065003A0000000000000001500000000042008600A1000D000200FFFF800026004F004B000000000000000000
29Relocations:
30- VirtualAddress: 96
31SymbolName: .rsrc
32Type: IMAGE_REL_AMD64_ADDR32NB
33- Name: '.text'
34Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
35Alignment: 16
36SectionData: B82A000000C3
37symbols:
38- Name: .rsrc
39Value: 0
40SectionNumber: 1
41SimpleType: IMAGE_SYM_TYPE_NULL
42ComplexType: IMAGE_SYM_DTYPE_NULL
43StorageClass: IMAGE_SYM_CLASS_STATIC
44- Name: '.text'
45Value: 0
46SectionNumber: 2
47SimpleType: IMAGE_SYM_TYPE_NULL
48ComplexType: IMAGE_SYM_DTYPE_NULL
49StorageClass: IMAGE_SYM_CLASS_STATIC
50SectionDefinition:
51Length: 6
52NumberOfRelocations: 0
53NumberOfLinenumbers: 0
54CheckSum: 0
55Number: 0
56- Name: main
57Value: 0
58SectionNumber: 2
59SimpleType: IMAGE_SYM_TYPE_NULL
60ComplexType: IMAGE_SYM_DTYPE_FUNCTION
61StorageClass: IMAGE_SYM_CLASS_EXTERNAL
62...
63