[lld] [LLD] Add support for two special OpenBSD sections (PR #97122)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 21:27:23 PDT 2024


================
@@ -107,7 +107,8 @@ static StringRef getOutputSectionName(const InputSectionBase *s) {
   for (StringRef v :
        {".data.rel.ro", ".data", ".rodata", ".bss.rel.ro", ".bss", ".ldata",
         ".lrodata", ".lbss", ".gcc_except_table", ".init_array", ".fini_array",
-        ".tbss", ".tdata", ".ARM.exidx", ".ARM.extab", ".ctors", ".dtors"})
+        ".tbss", ".tdata", ".ARM.exidx", ".ARM.extab", ".ctors", ".dtors",
+        ".openbsd.randomdata", ".openbsd.mutable"})
----------------
MaskRay wrote:

OpenBSD is adding program headers in an alarming rate... (https://isopenbsdsecu.re/mitigations/)

While ad-hoc `PT_OPENBSD_*` are somewhat fine, changing the default linker script would add overhead for other OSes. Does OpenBSD really need this? I fairly strongly oppose to do this part of change.

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


More information about the llvm-commits mailing list