summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/SyntheticSections.h')
-rw-r--r--lld/ELF/SyntheticSections.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h
index 605144d77d8..e5a62955d65 100644
--- a/lld/ELF/SyntheticSections.h
+++ b/lld/ELF/SyntheticSections.h
@@ -699,6 +699,26 @@ public:
void writeTo(uint8_t *Buf) override;
};
+// A container for one or more linker generated thunks. Instances of these
+// thunks including ARM interworking and Mips LA25 PI to non-PI thunks.
+template <class ELFT> class ThunkSection : public SyntheticSection<ELFT> {
+public:
+ // ThunkSection in OS, with desired OutSecOff of Off
+ ThunkSection(OutputSectionBase *OS, uint64_t Off);
+
+ // Add a newly created Thunk to this container:
+ // Thunk is given offset from start of this InputSection
+ // Thunk defines a symbol in this InputSection that can be used as target
+ // of a relocation
+ void addThunk(Thunk<ELFT> *T);
+ size_t getSize() const override { return Size; }
+ void writeTo(uint8_t *Buf) override;
+
+private:
+ std::vector<const Thunk<ELFT> *> Thunks;
+ size_t Size = 0;
+};
+
template <class ELFT> InputSection<ELFT> *createCommonSection();
template <class ELFT> InputSection<ELFT> *createInterpSection();
template <class ELFT> MergeInputSection<ELFT> *createCommentSection();
OpenPOWER on IntegriCloud