[lld] [LLD][COFF] Add support for custom section layout (PR #152779)
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 25 08:58:43 PDT 2025
================
@@ -0,0 +1,122 @@
+RUN: yaml2obj %p/Inputs/sectionlayout.yaml -o %t.obj
+
+## Error on non-exist input layout file
+RUN: not lld-link /entry:main /sectionlayout:doesnotexist.txt %t.obj
+
+## Order in 1 -> 3 -> 2
+RUN: echo ".text1" > %t.layout.txt
+RUN: echo ".text3" >> %t.layout.txt
+RUN: echo ".text2" >> %t.layout.txt
+RUN: lld-link /out:%t.exe /entry:main /sectionlayout:%t.layout.txt %t.obj
+RUN: llvm-readobj --sections %t.exe | FileCheck -check-prefix=CHECK1 %s
+
+## While /sectionlayout:abc is valid, /sectionlayout:@abc is also accepted (to align with MS link.exe)
----------------
aganea wrote:
As a curiousity, do you know why the @ syntax exists?
https://github.com/llvm/llvm-project/pull/152779
More information about the llvm-commits
mailing list