• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: yaml2obj %s -o %t.obj
2
3# RUN: lld-link /out:%t.exe /entry:main %t.obj
4# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=DEFAULT-HEADER %s
5# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=DEFAULT-TEXT %s
6
7# DEFAULT-HEADER:    ImageBase: 0x140000000
8# DEFAULT-TEXT:      Contents of section .text:
9# DEFAULT-TEXT-NEXT: 1000 00000040 01000000
10
11# RUN: lld-link /out:%t.exe /entry:main %t.obj /base:0x280000000
12# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=BASE-HEADER %s
13# RUN: llvm-objdump -s %t.exe | FileCheck --check-prefix=BASE-TEXT %s
14
15# BASE-HEADER: ImageBase: 0x280000000
16# BASE-TEXT:      Contents of section .text:
17# BASE-TEXT-NEXT: 1000 00000080 02000000
18
19--- !COFF
20header:
21  Machine:         IMAGE_FILE_MACHINE_AMD64
22  Characteristics: []
23sections:
24  - Name:            .text
25    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
26    Alignment:       4096
27    SectionData:     0000000000000000
28    Relocations:
29      - VirtualAddress:  0
30        SymbolName:      __ImageBase
31        Type:            IMAGE_REL_AMD64_ADDR64
32symbols:
33  - Name:            .text
34    Value:           0
35    SectionNumber:   1
36    SimpleType:      IMAGE_SYM_TYPE_NULL
37    ComplexType:     IMAGE_SYM_DTYPE_NULL
38    StorageClass:    IMAGE_SYM_CLASS_STATIC
39    SectionDefinition:
40      Length:          8
41      NumberOfRelocations: 1
42      NumberOfLinenumbers: 0
43      CheckSum:        0
44      Number:          0
45  - Name:            main
46    Value:           0
47    SectionNumber:   1
48    SimpleType:      IMAGE_SYM_TYPE_NULL
49    ComplexType:     IMAGE_SYM_DTYPE_NULL
50    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
51  - Name:            __ImageBase
52    Value:           0
53    SectionNumber:   0
54    SimpleType:      IMAGE_SYM_TYPE_NULL
55    ComplexType:     IMAGE_SYM_DTYPE_NULL
56    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
57...
58