[lld] [LLD] Extend special OpenBSD support, but scope under ELFOSABI (PR #97122)

John Ericson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 06:11:25 PDT 2024


================
@@ -601,10 +601,16 @@ static bool isRelroSection(const OutputSection *sec) {
   // ELF in spirit. But in reality many linker features depend on
   // magic section names.
   StringRef s = sec->name;
-  return s == ".data.rel.ro" || s == ".bss.rel.ro" || s == ".ctors" ||
-         s == ".dtors" || s == ".jcr" || s == ".eh_frame" ||
-         s == ".fini_array" || s == ".init_array" ||
-         s == ".openbsd.randomdata" || s == ".preinit_array";
+
+  bool abiAgnostic = s == ".data.rel.ro" || s == ".bss.rel.ro" ||
----------------
Ericson2314 wrote:

@MaskRay I would sort of like to change it for consistency?


I ended up duplicating the test I had to change so we have a Linux and OpenBSD version, and this makes me feel better about coverage, etc.

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


More information about the llvm-commits mailing list