[lld] [LLD] Add support for two special OpenBSD sections (PR #97122)
John Ericson via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 22:31:24 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"})
----------------
Ericson2314 wrote:
I have not tried to bisect this patch, but I can assure you that with out my "hello world' did not run (because malloc in OpenBSD's libc uses `.openbsd.mutable` for the root object of the heap, and there was an issue initializing it).
OpenBSD has a much faster-moving ABI, and I agree we wouldn't want that intentional stability to affect other platforms that are not opting into it. This is why I lean towards gating all these things under `config->osabi == ELFOSABI_FREEBSD` --- OpenBSD therefore has its own sandbox where it is sure not to affect other platforms. I just don't know how to set `config->osbi` from the command-line in a satisfactory way, hence https://github.com/llvm/llvm-project/issues/97124
https://github.com/llvm/llvm-project/pull/97122
More information about the llvm-commits
mailing list