@@ -110,6 +110,40 @@ DISASMM-NEXT: ...
110
110
DISASMM-NEXT: 180002ffe: 00 00 addb %al, (%rax)
111
111
DISASMM-NEXT: 180003000: b8 06 00 00 00 movl $0x6, %eax
112
112
113
+ Merging data sections into code sections causes data to be separated from the code when sorting chunks.
114
+
115
+ RUN: lld-link -out:testdm.dll -machine:arm64ec arm64ec-func-sym.obj x86_64-func-sym.obj codemap.obj \
116
+ RUN: data-sec.obj loadconfig-arm64ec.obj -dll -noentry -merge:.testdata=.text -merge:.rdata=test
117
+
118
+ RUN: llvm-readobj --coff-load-config testdm.dll | FileCheck -check-prefix=CODEMAPDM %s
119
+ CODEMAPDM: CodeMap [
120
+ CODEMAPDM-NEXT: 0x2000 - 0x2008 ARM64EC
121
+ CODEMAPDM-NEXT: 0x3000 - 0x3006 X64
122
+ CODEMAPDM-NEXT: 0x5200 - 0x5208 ARM64EC
123
+ CODEMAPDM-NEXT: 0x6000 - 0x6006 X64
124
+ CODEMAPDM-NEXT: ]
125
+
126
+ RUN: llvm-objdump -d testdm.dll | FileCheck -check-prefix=DISASMDM %s
127
+ DISASMDM: Disassembly of section .text:
128
+ DISASMDM-EMPTY:
129
+ DISASMDM-NEXT: 0000000180001000 <.text>:
130
+ DISASMDM-NEXT: 180001000: 00000001 udf #0x1
131
+ DISASMDM-NEXT: ...
132
+ DISASMDM-NEXT: 180002000: 52800040 mov w0, #0x2
133
+ DISASMDM-NEXT: 180002004: d65f03c0 ret
134
+ DISASMDM-NEXT: ...
135
+ DISASMDM-NEXT: 180003000: b8 03 00 00 00 movl $0x3, %eax
136
+ DISASMDM-NEXT: 180003005: c3 retq
137
+ DISASMDM-EMPTY:
138
+ DISASMDM-NEXT: Disassembly of section test:
139
+ DISASMDM-EMPTY:
140
+ DISASMDM-NEXT: 0000000180005000 <test>:
141
+ DISASMDM: 180005200: 528000a0 mov w0, #0x5
142
+ DISASMDM-NEXT: 180005204: d65f03c0 ret
143
+ DISASMDM-NEXT: ...
144
+ DISASMDM-NEXT: 180006000: b8 06 00 00 00 movl $0x6, %eax
145
+ DISASMDM-NEXT: 180006005: c3 retq
146
+
113
147
#--- arm64-func-sym.s
114
148
.text
115
149
.globl arm64_func_sym
@@ -148,6 +182,10 @@ x86_64_func_sym2:
148
182
movl $6, %eax
149
183
retq
150
184
185
+ #--- data-sec.s
186
+ .section .testdata, "rd"
187
+ .xword 1
188
+
151
189
#--- codemap.s
152
190
.section .rdata,"dr"
153
191
.globl code_map
0 commit comments