2017-07-20 13:49:54 +08:00
|
|
|
# REQUIRES: aarch64
|
|
|
|
|
|
|
|
# RUN: yaml2obj < %s > %t.obj
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t.obj | FileCheck %s --check-prefix BEFORE
|
2017-07-20 13:49:54 +08:00
|
|
|
# RUN: lld-link /entry:main /subsystem:console /out:%t.exe %t.obj %p/Inputs/library-arm64.lib %p/Inputs/library2-arm64.lib
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t.exe | FileCheck %s --check-prefix AFTER
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-imports %t.exe | FileCheck %s -check-prefix IMPORTS
|
2017-07-20 13:49:54 +08:00
|
|
|
|
|
|
|
# BEFORE: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
# BEFORE-EMPTY:
|
2020-04-10 09:46:35 +08:00
|
|
|
# BEFORE: 0: 00 00 00 94 bl 0x0
|
|
|
|
# BEFORE: 4: 00 00 00 94 bl 0x4
|
2017-07-20 13:49:54 +08:00
|
|
|
# BEFORE: 8: c0 03 5f d6 ret
|
2020-04-09 05:42:50 +08:00
|
|
|
# BEFORE: c: ff <unknown>
|
2017-07-20 13:49:54 +08:00
|
|
|
|
|
|
|
# AFTER: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
# AFTER-EMPTY:
|
2020-04-09 05:42:50 +08:00
|
|
|
# AFTER: 140001000: 04 00 00 94 bl 0x140001010
|
|
|
|
# AFTER: 140001004: 06 00 00 94 bl 0x14000101c
|
2017-07-20 13:49:54 +08:00
|
|
|
# AFTER: 140001008: c0 03 5f d6 ret
|
2020-04-09 05:42:50 +08:00
|
|
|
# AFTER: 14000100c: ff cc cc cc <unknown>
|
|
|
|
# AFTER: 140001010: 10 00 00 b0 adrp x16, #4096
|
|
|
|
# AFTER: 140001014: 10 32 40 f9 ldr x16, [x16, #96]
|
|
|
|
# AFTER: 140001018: 00 02 1f d6 br x16
|
|
|
|
# AFTER: 14000101c: 10 00 00 b0 adrp x16, #4096
|
|
|
|
# AFTER: 140001020: 10 3a 40 f9 ldr x16, [x16, #112]
|
|
|
|
# AFTER: 140001024: 00 02 1f d6 br x16
|
2017-07-20 13:49:54 +08:00
|
|
|
|
|
|
|
# IMPORTS: Import {
|
|
|
|
# IMPORTS: Name: library.dll
|
|
|
|
# IMPORTS: ImportLookupTableRVA: 0x2040
|
|
|
|
# IMPORTS: ImportAddressTableRVA: 0x2060
|
|
|
|
# IMPORTS: Symbol: function (2)
|
|
|
|
# IMPORTS: }
|
|
|
|
# IMPORTS: Import {
|
|
|
|
# IMPORTS: Name: library2.dll
|
|
|
|
# IMPORTS: ImportLookupTableRVA: 0x2050
|
|
|
|
# IMPORTS: ImportAddressTableRVA: 0x2070
|
|
|
|
# IMPORTS: Symbol: function2 (0)
|
|
|
|
# IMPORTS: }
|
|
|
|
|
|
|
|
--- !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
|
2020-04-09 05:42:50 +08:00
|
|
|
SectionData: 0000009400000094C0035FD6FF
|
2017-07-20 13:49:54 +08:00
|
|
|
Relocations:
|
|
|
|
- VirtualAddress: 0
|
|
|
|
SymbolName: function
|
2017-11-06 15:22:17 +08:00
|
|
|
Type: IMAGE_REL_ARM64_BRANCH26
|
2017-07-20 13:49:54 +08:00
|
|
|
- VirtualAddress: 4
|
|
|
|
SymbolName: function2
|
2017-11-06 15:22:17 +08:00
|
|
|
Type: IMAGE_REL_ARM64_BRANCH26
|
2017-07-20 13:49:54 +08:00
|
|
|
symbols:
|
|
|
|
- Name: .text
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_STATIC
|
|
|
|
SectionDefinition:
|
|
|
|
Length: 12
|
|
|
|
NumberOfRelocations: 2
|
|
|
|
NumberOfLinenumbers: 0
|
|
|
|
CheckSum: 1438860354
|
|
|
|
Number: 1
|
|
|
|
- Name: main
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 1
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
- Name: function
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 0
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
- Name: function2
|
|
|
|
Value: 0
|
|
|
|
SectionNumber: 0
|
|
|
|
SimpleType: IMAGE_SYM_TYPE_NULL
|
|
|
|
ComplexType: IMAGE_SYM_DTYPE_NULL
|
|
|
|
StorageClass: IMAGE_SYM_CLASS_EXTERNAL
|
|
|
|
...
|