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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 22:39:40 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" ||
----------------
MaskRay wrote:

It should be fine to keep this unchanged. We can add the osabi check if the `.openbsd.*` list ever gets longer.

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


More information about the llvm-commits mailing list