summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.h
diff options
context:
space:
mode:
authorPeter Smith <peter.smith@linaro.org>2017-01-27 13:10:16 +0000
committerPeter Smith <peter.smith@linaro.org>2017-01-27 13:10:16 +0000
commit5191c6f9456f893ff6160b83b6a5d816c0535fff (patch)
treeee04436fc242d7c458f47b4090a40aae3a5ed6be /lld/ELF/Target.h
parent810055ee232cd1c60714a14bdd13dde17590bc53 (diff)
downloadbcm5719-llvm-5191c6f9456f893ff6160b83b6a5d816c0535fff.tar.gz
bcm5719-llvm-5191c6f9456f893ff6160b83b6a5d816c0535fff.zip
[ELF][ARM] Use SyntheticSections for Thunks
Thunks are now implemented by redirecting the relocation to the symbol S, to a symbol TS in a Thunk. The Thunk will transfer control to S. This has the following implications: - All the side-effects of Thunks happen within createThunks() - Thunks are no longer stored in InputSections and Symbols no longer need to hold a pointer to a Thunk - The synthetic Thunk sections need to be merged into OutputSections This implementation is almost a direct conversion of the existing Thunks with the following exceptions: - Mips LA25 Thunks are placed before the InputSection that defines the symbol that needs a Thunk. - All ARM Thunks are placed at the end of the OutputSection of the first caller to the Thunk. Range extension Thunks are not supported yet so it is optimistically assumed that all Thunks can be reused. Differential Revision: https://reviews.llvm.org/D29129 llvm-svn: 293283
Diffstat (limited to 'lld/ELF/Target.h')
-rw-r--r--lld/ELF/Target.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h
index 76db720d4da..e439b20f852 100644
--- a/lld/ELF/Target.h
+++ b/lld/ELF/Target.h
@@ -41,8 +41,8 @@ public:
virtual void writePlt(uint8_t *Buf, uint64_t GotEntryAddr,
uint64_t PltEntryAddr, int32_t Index,
unsigned RelOff) const {}
- virtual void addPltHeaderSymbols(InputSectionData* IS) const {}
- virtual void addPltSymbols(InputSectionData* IS, uint64_t Off) const {}
+ virtual void addPltHeaderSymbols(InputSectionData *IS) const {}
+ virtual void addPltSymbols(InputSectionData *IS, uint64_t Off) const {}
// Returns true if a relocation only uses the low bits of a value such that
// all those bits are in in the same page. For example, if the relocation
// only uses the low 12 bits in a system with 4k pages. If this is true, the
@@ -51,14 +51,9 @@ public:
virtual bool usesOnlyLowPageBits(uint32_t Type) const;
// Decide whether a Thunk is needed for the relocation from File
- // targeting S. Returns one of:
- // Expr if there is no Thunk required
- // R_THUNK_ABS if thunk is required and expression is absolute
- // R_THUNK_PC if thunk is required and expression is pc rel
- // R_THUNK_PLT_PC if thunk is required to PLT entry and expression is pc rel
- virtual RelExpr getThunkExpr(RelExpr Expr, uint32_t RelocType,
- const InputFile *File,
- const SymbolBody &S) const;
+ // targeting S.
+ virtual bool needsThunk(RelExpr Expr, uint32_t RelocType,
+ const InputFile *File, const SymbolBody &S) const;
virtual RelExpr getRelExpr(uint32_t Type, const SymbolBody &S) const = 0;
virtual void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const = 0;
virtual ~TargetInfo();
OpenPOWER on IntegriCloud