[PATCH] D80177: [lld-macho] Set __PAGEZERO size to 4GB

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 12:38:05 PDT 2020


smeenai added inline comments.


================
Comment at: lld/MachO/Symbols.h:110
+    return d->isec->getFileOffset() + d->value;
+  return 0;
+}
----------------
smeenai wrote:
> int3 wrote:
> > smeenai wrote:
> > > This is *definitely* follow-up territory, but we should figure out if it ever makes sense for `getFileOffset` to be called on a non-defined symbol, and if not, just fail loudly in that case instead of silently returning 0.
> > oh good point. I doubt it would ever be valid; I can just insert a `fatal` here. Does it really need to be in a follow-up?
> It doesn't need to be a follow-up. I just didn't mean the comment to block this diff, but folding it in here is great too.
I'd probably use llvm_unreachable, since reaching this would be purely a logic error in the linker rather then e.g. something that could be triggered by broken or unsupported input.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80177





More information about the llvm-commits mailing list