summaryrefslogtreecommitdiff
path: root/ELF/Relocations.h
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Relocations.h')
-rw-r--r--ELF/Relocations.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/ELF/Relocations.h b/ELF/Relocations.h
index dcbf545cde53..445308b27cec 100644
--- a/ELF/Relocations.h
+++ b/ELF/Relocations.h
@@ -126,6 +126,11 @@ public:
// Return true if Thunks have been added to OutputSections
bool createThunks(ArrayRef<OutputSectionCommand *> OutputSections);
+ // The number of completed passes of createThunks this permits us
+ // to do one time initialization on Pass 0 and put a limit on the
+ // number of times it can be called to prevent infinite loops.
+ uint32_t Pass = 0;
+
private:
void mergeThunks();
ThunkSection *getOSThunkSec(OutputSection *OS,
@@ -137,14 +142,22 @@ private:
InputSection *)>
Fn);
std::pair<Thunk *, bool> getThunk(SymbolBody &Body, uint32_t Type);
-
+ ThunkSection *addThunkSection(OutputSection *OS,
+ std::vector<InputSection *> *, uint64_t Off);
// Track Symbols that already have a Thunk
llvm::DenseMap<SymbolBody *, Thunk *> ThunkedSymbols;
+ // Find a Thunk from the Thunks symbol definition, we can use this to find
+ // the Thunk from a relocation to the Thunks symbol definition.
+ llvm::DenseMap<SymbolBody *, Thunk *> Thunks;
+
// Track InputSections that have a ThunkSection placed in front
llvm::DenseMap<InputSection *, ThunkSection *> ThunkedSections;
- // Track the ThunksSections that need to be inserted into an OutputSection
+ // All the ThunkSections that we have created, organised by OutputSection
+ // will contain a mix of ThunkSections that have been created this pass, and
+ // ThunkSections that have been merged into the OutputSection on previous
+ // passes
std::map<std::vector<InputSection *> *, std::vector<ThunkSection *>>
ThunkSections;