[lld] [LLD] Implement --enable-non-contiguous-regions (PR #90007)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 16:32:10 PDT 2024


================
@@ -0,0 +1,279 @@
+# REQUIRES: x86
+
+# RUN: split-file %s %t
+# RUN: llvm-mc -n -filetype=obj -triple=x86_64 %t/spill.s -o %t/spill.o
+
+## An input section must spill to a later match if the region of its first match
+## would overflow.
+
+# RUN: ld.lld -T %t/spill.ld %t/spill.o -o %t/spill --enable-non-contiguous-regions
+# RUN: llvm-readelf -S %t/spill | FileCheck %s -check-prefix=SPILL
+
+# SPILL:      Name          Type     Address          Off    Size
+# SPILL:      .first_chance PROGBITS 0000000000000000 001000 000001
+# SPILL-NEXT: .last_chance  PROGBITS 0000000000000002 001002 000002
+
+## A spill off the end must still fail the link.
+
+# RUN: not ld.lld -T %t/spill-fail.ld %t/spill.o -o %t/spill-fail --enable-non-contiguous-regions 2>&1 |\
+# RUN:   FileCheck %s -check-prefix=SPILL-FAIL
----------------
mysterymath wrote:

Done.

https://github.com/llvm/llvm-project/pull/90007


More information about the llvm-commits mailing list