2017-07-19 02:40:50 +08:00
|
|
|
# REQUIRES: x86
|
2015-05-29 03:09:30 +08:00
|
|
|
# Verify that the lld can handle .lib files and emit .idata sections.
|
|
|
|
#
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.exe /entry:main /subsystem:console \
|
2015-05-31 11:55:46 +08:00
|
|
|
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t.exe | FileCheck --check-prefix=TEXT %s
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
|
2015-05-29 03:09:30 +08:00
|
|
|
|
2015-08-07 00:47:46 +08:00
|
|
|
# RUN: lld-link /out:%t.exe /entry:main /subsystem:console \
|
2015-07-04 09:10:32 +08:00
|
|
|
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib /include:ExitProcess
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -d %t.exe | FileCheck --check-prefix=TEXT %s
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=IMPORT %s
|
2015-07-04 09:10:32 +08:00
|
|
|
|
2015-05-29 03:09:30 +08:00
|
|
|
TEXT: Disassembly of section .text:
|
2019-05-01 18:40:48 +08:00
|
|
|
TEXT-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
TEXT-NEXT: <.text>:
|
2015-05-29 03:09:30 +08:00
|
|
|
TEXT-NEXT: subq $40, %rsp
|
|
|
|
TEXT-NEXT: movq $0, %rcx
|
2018-04-18 07:28:52 +08:00
|
|
|
TEXT-NEXT: leaq 8180(%rip), %rdx
|
|
|
|
TEXT-NEXT: leaq 8167(%rip), %r8
|
2015-05-29 03:09:30 +08:00
|
|
|
TEXT-NEXT: movl $0, %r9d
|
2020-03-23 06:03:10 +08:00
|
|
|
TEXT-NEXT: callq 0x140001060
|
2015-05-29 03:09:30 +08:00
|
|
|
TEXT-NEXT: movl $0, %ecx
|
2020-03-23 06:03:10 +08:00
|
|
|
TEXT-NEXT: callq 0x140001040
|
|
|
|
TEXT-NEXT: callq 0x140001050
|
2018-04-18 07:28:52 +08:00
|
|
|
TEXT: jmpq *4098(%rip)
|
|
|
|
TEXT: jmpq *4090(%rip)
|
|
|
|
TEXT: jmpq *4082(%rip)
|
2015-05-29 03:09:30 +08:00
|
|
|
|
|
|
|
IMPORT: Import {
|
|
|
|
IMPORT-NEXT: Name: std64.dll
|
2018-04-18 07:28:52 +08:00
|
|
|
IMPORT-NEXT: ImportLookupTableRVA: 0x2028
|
|
|
|
IMPORT-NEXT: ImportAddressTableRVA: 0x2048
|
2015-05-29 03:09:30 +08:00
|
|
|
IMPORT-NEXT: Symbol: ExitProcess (0)
|
2015-06-02 05:05:27 +08:00
|
|
|
IMPORT-NEXT: Symbol: (50)
|
2015-05-29 23:45:35 +08:00
|
|
|
IMPORT-NEXT: Symbol: MessageBoxA (1)
|
2015-05-29 03:09:30 +08:00
|
|
|
IMPORT-NEXT: }
|
2019-01-25 03:02:31 +08:00
|
|
|
|
|
|
|
# RUN: lld-link /out:%t.exe /entry:main /subsystem:console /merge:.rdata=.text \
|
|
|
|
# RUN: %p/Inputs/hello64.obj %p/Inputs/std64.lib /include:ExitProcess
|
2019-05-01 13:49:01 +08:00
|
|
|
# RUN: llvm-readobj --coff-imports %t.exe | FileCheck -check-prefix=MERGE %s
|
2019-01-25 03:02:31 +08:00
|
|
|
|
|
|
|
MERGE: Import {
|
|
|
|
MERGE-NEXT: Name: std64.dll
|
|
|
|
MERGE-NEXT: ImportLookupTableRVA: 0x1090
|
|
|
|
MERGE-NEXT: ImportAddressTableRVA: 0x10B0
|
|
|
|
MERGE-NEXT: Symbol: ExitProcess (0)
|
|
|
|
MERGE-NEXT: Symbol: (50)
|
|
|
|
MERGE-NEXT: Symbol: MessageBoxA (1)
|
|
|
|
MERGE-NEXT: }
|