[lld] [LLD] Add CLASS syntax to SECTIONS (PR #95323)

Daniel Thornburgh via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 16:29:42 PDT 2024


================
@@ -0,0 +1,433 @@
+# REQUIRES: x86
+
+# RUN: rm -rf %t && split-file %s %t && cd %t
+
+# RUN: llvm-mc -n -filetype=obj -triple=x86_64 matching.s -o matching.o
+
+## CLASS definitions match sections in linker script order. The sections may be
+## placed in a different order. Classes may derive from one another, and class
+## references may be restricted by INPUT_SECTION_FLAGS.
+
+# RUN: ld.lld -T matching.ld matching.o -o matching
+# RUN: llvm-readobj -x .rodata -x .rodata.d matching | FileCheck %s --check-prefix=MATCHING
+
+# MATCHING:      .rodata
+# MATCHING-NEXT: 020301cc 0605
+# MATCHING:      .rodata.d
+# MATCHING-NEXT: 04
+
----------------
mysterymath wrote:

The latter cleans things up quite a bit; done. Also TIL you can use `#` as a comment in LLD linker scripts.

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


More information about the llvm-commits mailing list