[lld] [lld][ELF] Improve the vulnerability in Orphan Sections initialization (PR #156354)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 05:32:44 PDT 2025


================
@@ -0,0 +1,30 @@
+# REQUIRES: x86
+# RUN: rm -rf %t && mkdir -p %t
+# RUN: split-file %s %t && cd %t
+
----------------
smithp35 wrote:

Could you add a comment to explain the test. Without context the steps look strange. LLD uses an additional comment character to distinguish comments from lit commands, so comment lines would start `##`

For example:
```
Test that lld's orphan section placement can handle a relocatable link where the relocation section is seen before the relocated section. To create a test case we need to first need to create a relocatable object with
the relocations before the relocated section. Then we rename these to make these orphans.
```

I tried to see if I could create the test case without llvm-objcopy but it seemed like I needed the linker script to have .rela.text as the pattern to get it to place first.

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


More information about the llvm-commits mailing list