[PATCH] D114166: [ELF] Expand LMA region if output section alignment introduces padding

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 19 01:05:48 PST 2021


ikudrin added inline comments.


================
Comment at: lld/ELF/LinkerScript.cpp:981-986
+  } else if (MemoryRegion *mr = sec->lmaRegion) {
+    uint64_t lmaStart = alignTo(mr->curPos, sec->alignment);
+    if (mr->curPos < lmaStart)
+      expandMemoryRegion(ctx->lmaRegion, lmaStart - ctx->lmaRegion->curPos,
+                         ctx->lmaRegion->name, sec->name);
+    ctx->lmaOffset = lmaStart - dot;
----------------
`ctx->lmaRegion` is the same as `mr`/`sec->lmaRegion` due to the assignment on line 944. Referencing it by different names is a bit bewildering.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114166/new/

https://reviews.llvm.org/D114166



More information about the llvm-commits mailing list