[PATCH] D100818: [lld-macho] Implement branch-range-extension thunks

Greg McGary via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 3 22:26:22 PDT 2021


gkm marked 7 inline comments as done.
gkm added inline comments.


================
Comment at: lld/MachO/MergedOutputSection.cpp:233-244
+  size_t i = 0, ie = inputs.size();
+  size_t t = 0, te = thunks.size();
+  while (i < ie || t < te) {
+    while (i < ie && (t == te || inputs[i]->getSize() == 0 ||
+                      inputs[i]->outSecOff < thunks[t]->outSecOff)) {
+      inputs[i]->writeTo(buf + inputs[i]->outSecFileOff);
+      i++;
----------------
int3 wrote:
> gkm wrote:
> > int3 wrote:
> > > instead of two sorted arrays, would it be simpler to create a map of regular InputSection to an array of thunks that immediately follow it?
> > Sounds like more overhead & thus slower.
> Simpler code-wise though. This isn't likely to be perf-critical...
I wish to punt on this for now. I will revisit after I get big programs to run with thunks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100818



More information about the llvm-commits mailing list