[PATCH] D34692: [LLD][ELF] Add support for multiple passes to createThunks()

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 17:48:26 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Relocations.cpp:1299-1303
+            // If we are a relocation to an existing Thunk, check if it is
+            // still in range. If not then Rel will be altered to point to its
+            // original target so another Thunk can be generated.
+            if (Pass > 0 && normalizeExistingThunk(Rel, Src))
+              continue;
----------------
I think it feels more natural if you move this piece of code after `needsThunk` check.



================
Comment at: ELF/Relocations.h:179
+  // All the ThunkSections that we have created, organised by InputSectionRange
+  std::map<std::vector<InputSection *> *, std::vector<ThunkSection *>>
+      NewThunkSections;
----------------
Using a `std::vector<T> *` as a key seems a bit odd to me. IIUC, this vector is a member of InputSection, so we can attach a vector of ThunkSections to InputSections, no?


================
Comment at: ELF/Thunks.h:52
   SymbolBody *ThunkSym;
   uint64_t Offset;
   uint32_t Alignment = 4;
----------------
Offset = 0


https://reviews.llvm.org/D34692





More information about the llvm-commits mailing list