[PATCH] D87852: [lld-macho] Allow the entry symbol to be dynamically bound

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 14:23:40 PDT 2020


int3 added inline comments.


================
Comment at: lld/MachO/Writer.cpp:196
+      c->entryoff =
+          in.stubs->fileOff + config->entry->stubsIndex * target->stubSize;
+    else
----------------
smeenai wrote:
> Possible follow-up: I think this calculation is done in a bunch of places. Is there a nice place where a function for this calculation could live?
it's not really identical with anything else -- I mean, there's another place where we do `addr + stubsIndex * stubSize`, but here we are calculating the file offset and not the address. There are also a bunch of other places where we multiply by WordSize (to index into `__la_symbol_ptrs`) instead of by stubSize.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87852



More information about the llvm-commits mailing list