brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.3 KiB · 5934057 Raw
106 lines · plain
1REQUIRES: aarch64, x862RUN: split-file %s %t.dir && cd %t.dir3 4RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-patchable.s -o arm64ec-patchable.obj5RUN: llvm-mc -filetype=obj -triple=arm64ec-windows arm64ec-alias.s -o arm64ec-alias.obj6RUN: llvm-mc -filetype=obj -triple=arm64ec-windows test-sec.s -o test-sec.obj7RUN: llvm-mc -filetype=obj -triple=arm64ec-windows %S/Inputs/loadconfig-arm64ec.s -o loadconfig-arm64ec.obj8RUN: llvm-mc -filetype=obj -triple=aarch64-windows %S/Inputs/loadconfig-arm64.s -o loadconfig-arm64.obj9 10RUN: lld-link -out:test.dll -machine:arm64ec arm64ec-patchable.obj test-sec.obj loadconfig-arm64ec.obj -dll -noentry11 12RUN: llvm-objdump -d test.dll | FileCheck -check-prefix=PATCH-DISASM %s13PATCH-DISASM:      Disassembly of section .text:14PATCH-DISASM-EMPTY:15PATCH-DISASM-NEXT: 0000000180001000 <.text>:16PATCH-DISASM-NEXT: 180001000: 52800040     mov     w0, #0x2                // =217PATCH-DISASM-NEXT: 180001004: d65f03c0     ret18PATCH-DISASM-EMPTY:19PATCH-DISASM-NEXT: Disassembly of section .hexpthk:20PATCH-DISASM-EMPTY:21PATCH-DISASM-NEXT: 000000018000200022PATCH-DISASM-NEXT: 180002000: 48 8b c4                     movq    %rsp, %rax23PATCH-DISASM-NEXT: 180002003: 48 89 58 20                  movq    %rbx, 0x20(%rax)24PATCH-DISASM-NEXT: 180002007: 55                           pushq   %rbp25PATCH-DISASM-NEXT: 180002008: 5d                           popq    %rbp26PATCH-DISASM-NEXT: 180002009: e9 f2 ef ff ff               jmp     0x180001000 <.text>27PATCH-DISASM-NEXT: 18000200e: cc                           int328PATCH-DISASM-NEXT: 18000200f: cc                           int329 30RUN: llvm-readobj --hex-dump=.test test.dll | FileCheck -check-prefix=RVA %s31RVA: 0x180006000 0020000032 33RUN: llvm-readobj --coff-load-config test.dll | FileCheck -check-prefix=PATCH-CHPE %s34PATCH-CHPE:       CodeMap [35PATCH-CHPE-NEXT:    0x1000 - 0x1008  ARM64EC36PATCH-CHPE-NEXT:    0x2000 - 0x2010  X6437PATCH-CHPE-NEXT:  ]38PATCH-CHPE-NEXT:  CodeRangesToEntryPoints [39PATCH-CHPE-NEXT:    0x2000 - 0x2010 -> 0x200040PATCH-CHPE-NEXT:  ]41PATCH-CHPE-NEXT:  RedirectionMetadata [42PATCH-CHPE-NEXT:    0x2000 -> 0x100043PATCH-CHPE-NEXT:  ]44 45 46RUN: lld-link -out:test2.dll -machine:arm64ec arm64ec-alias.obj test-sec.obj loadconfig-arm64ec.obj -dll -noentry47 48RUN: llvm-objdump -d test2.dll | FileCheck -check-prefix=PATCH-DISASM %s49RUN: llvm-readobj --hex-dump=.test test2.dll | FileCheck -check-prefix=RVA %s50RUN: llvm-readobj --coff-load-config test2.dll | FileCheck -check-prefix=PATCH-CHPE %s51 52RUN: lld-link -out:test3.dll -machine:arm64ec arm64ec-alias.obj test-sec.obj loadconfig-arm64ec.obj -dll -noentry -export:patchable_func53 54RUN: llvm-objdump -d test3.dll | FileCheck -check-prefix=PATCH-DISASM %s55RUN: llvm-readobj --hex-dump=.test test3.dll | FileCheck -check-prefix=RVA %s56RUN: llvm-readobj --coff-load-config test3.dll | FileCheck -check-prefix=PATCH-CHPE %s57 58 59RUN: not lld-link -out:test4.dll -machine:arm64ec test-sec.obj loadconfig-arm64ec.obj -dll -noentry 2>&1 | FileCheck --check-prefix=ERR %s60ERR: error: undefined symbol: EXP+#patchable_func (EC symbol)61 62 63RUN: lld-link -out:testx.dll -machine:arm64x arm64ec-patchable.obj test-sec.obj \64RUN:          loadconfig-arm64.obj loadconfig-arm64ec.obj -dll -noentry65RUN: llvm-objdump -d testx.dll | FileCheck -check-prefix=PATCH-DISASM %s66RUN: llvm-readobj --coff-load-config testx.dll | FileCheck -check-prefix=PATCH-CHPE %s67 68 69RUN: lld-link -out:testx2.dll -machine:arm64x arm64ec-alias.obj loadconfig-arm64.obj \70RUN:          loadconfig-arm64ec.obj -dll -noentry71RUN: llvm-objdump -d testx2.dll | FileCheck -check-prefix=PATCH-DISASM %s72RUN: llvm-readobj --coff-load-config testx2.dll | FileCheck -check-prefix=PATCH-CHPE %s73 74 75#--- arm64ec-patchable.s76    .section ".text", "x", discard, "#patchable_func$hp_target"77    .globl "#patchable_func$hp_target"78    .p2align 2, 0x079"#patchable_func$hp_target":80    mov w0, #281    ret82 83    .def "EXP+#patchable_func"84    .scl 285    .type 3286    .endef87 88#--- arm64ec-alias.s89    .section ".text", "x", discard, "#patchable_func$hp_target"90    .globl "#patchable_func$hp_target"91    .p2align 2, 0x092"#patchable_func$hp_target":93    mov w0, #294    ret95 96    .def "EXP+#patchable_func"97    .scl 298    .type 3299    .endef100    .weak patchable_func101patchable_func = "EXP+#patchable_func"102 103#--- test-sec.s104    .section ".test", "rd"105    .rva "EXP+#patchable_func"106