Index: lld/ELF/Config.h
--- lld/ELF/Config.h.orig
+++ lld/ELF/Config.h
@@ -71,6 +71,9 @@ class IpltSection;
 class MemtagAndroidNote;
 class MemtagGlobalDescriptors;
 class MipsGotSection;
+#if defined(__OpenBSD__)
+class MipsStubsSection;
+#endif
 class PPC64LongBranchTargetSection;
 class PackageMetadataNote;
 class PltSection;
@@ -476,8 +479,13 @@ struct Config {
   ELFKind ekind = ELFNoneKind;
   uint16_t emachine = llvm::ELF::EM_NONE;
   std::optional<uint64_t> imageBase;
+  // commonPageSize and maxPageSize are influenced by nmagic or omagic
+  // so may be set to 1 if either of those options is given.
   uint64_t commonPageSize;
   uint64_t maxPageSize;
+  // textAlignPageSize is the target max page size for the purpose
+  // of aligning text sections, which may be unaligned if given nmagic
+  uint64_t textAlignPageSize;
   uint64_t mipsGotSize;
   uint64_t zStackSize;
   unsigned ltoPartitions;
@@ -636,6 +644,9 @@ struct InStruct {
   std::unique_ptr<SyntheticSection> mipsOptions;
   std::unique_ptr<SyntheticSection> mipsReginfo;
   std::unique_ptr<SyntheticSection> mipsRldMap;
+#if defined(__OpenBSD__)
+  std::unique_ptr<MipsStubsSection> mipsStubs;
+#endif
   std::unique_ptr<SyntheticSection> ppc32Got2;
   // Non-SHF_ALLOC sections
   std::unique_ptr<SyntheticSection> debugNames;
@@ -676,6 +687,9 @@ struct Ctx : CommonLinkerContext {
   struct ElfSym {
     // __bss_start
     Defined *bss;
+
+    // __data_start
+    Defined *data;
 
     // etext and _etext
     Defined *etext1;
