[ELF] relocateNonAlloc: clean up workaround code
[llvm-project.git] / lld / test / COFF / icf-xdata-last.s
blobd8ad7d394fb37f79fc555f805f6ee6a7be940a3a
1 # REQUIRES: x86
2 # RUN: llvm-mc %s -filetype=obj -triple=x86_64-windows-msvc -o %t.obj
3 # RUN: lld-link %t.obj -export:foo -export:bar -dll -noentry -out:%t.dll -merge:.xdata=.xdata -verbose 2>&1 | FileCheck %s
4 # RUN: llvm-readobj --sections %t.dll | FileCheck %s --check-prefix=XDATA
6 # Test xdata can be merged when text and pdata differ. This test is structured
7 # so that xdata comes after pdata, which makes xdata come before pdata in the
8 # assocChildren linked list.
10 # CHECK: ICF needed {{.*}} iterations
11 # CHECK: Selected
12 # CHECK: Removed
14 # XDATA: Name: .xdata
15 # XDATA-NEXT: VirtualSize: 0x4
17 .section .text,"xr",discard,foo
18 .globl foo
19 foo:
20 pushq %rax
21 popq %rax
22 retq
24 .section .pdata,"r",associative,foo
25 .long foo
26 .long 5
27 .long foo_xdata@IMGREL
30 .section .xdata,"r",associative,foo
31 foo_xdata:
32 .long 42
34 .section .text,"xr",discard,bar
35 .globl bar
36 bar:
37 pushq %rcx
38 popq %rcx
39 retq
41 .section .pdata,"r",associative,bar
42 .long bar
43 .long 5
44 .long bar_xdata@IMGREL
46 .section .xdata,"r",associative,bar
47 bar_xdata:
48 .long 42