Sunho Kim db995d72db [JITLink][COFF] Initial COFF support.
Adds initial COFF support in JITLink. This is able to run a hello world c program in x86 windows successfully.

Implemented
- COFF object loader
- Static local symbols
- Absolute symbols
- External symbols
- Weak external symbols
- Common symbols
- COFF jitlink-check support
- All COMDAT selection type execpt largest
- Implicit symobl size calculation
- Rel32 relocation with PLT stub.
- IMAGE_REL_AMD64_ADDR32NB relocation

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D128968
2022-07-13 03:52:43 +09:00

30 lines
465 B
ArmAsm

# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %s -o %t
# RUN: llvm-jitlink -noexec %t
#
# Check a basic COFF object file loads successfully.
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
.set @feat.00, 0
.file "main.c"
.def main;
.scl 2;
.type 32;
.endef
.globl main
.p2align 4, 0x90
main:
.seh_proc main
pushq %rax
.seh_stackalloc 8
.seh_endprologue
movl $0, 4(%rsp)
xorl %eax, %eax
popq %rcx
retq
.seh_endproc