summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/ELF/TargetHandler.h
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2014-01-27 01:02:03 +0000
committerShankar Easwaran <shankare@codeaurora.org>2014-01-27 01:02:03 +0000
commite7b831ad354c74ef9fb12b8501e4c5de676a2bc6 (patch)
treedd5307b45131ff4c4f907f7ec3417f80208e6ee6 /lld/lib/ReaderWriter/ELF/TargetHandler.h
parent51577b66ce478fafc3cbd7614255742ceff65237 (diff)
downloadbcm5719-llvm-e7b831ad354c74ef9fb12b8501e4c5de676a2bc6.tar.gz
bcm5719-llvm-e7b831ad354c74ef9fb12b8501e4c5de676a2bc6.zip
[ELF] Add Target specific Readers.
No change in functionality. llvm-svn: 200175
Diffstat (limited to 'lld/lib/ReaderWriter/ELF/TargetHandler.h')
-rw-r--r--lld/lib/ReaderWriter/ELF/TargetHandler.h39
1 files changed, 4 insertions, 35 deletions
diff --git a/lld/lib/ReaderWriter/ELF/TargetHandler.h b/lld/lib/ReaderWriter/ELF/TargetHandler.h
index c2c30de165c..eb5c0de7091 100644
--- a/lld/lib/ReaderWriter/ELF/TargetHandler.h
+++ b/lld/lib/ReaderWriter/ELF/TargetHandler.h
@@ -40,44 +40,12 @@ template <class ELFT> class ELFHeader;
template <class ELFT> class Section;
template <class ELFT> class TargetLayout;
-/// \brief The target registers a set of handlers for overriding target specific
-/// attributes for a DefinedAtom. The Reader uses this class to query for the
-/// type of atom and its permissions
-template <class ELFT> class TargetAtomHandler {
-public:
- typedef llvm::object::Elf_Shdr_Impl<ELFT> Elf_Shdr;
- typedef llvm::object::Elf_Sym_Impl<ELFT> Elf_Sym;
-
- virtual DefinedAtom::ContentType
- contentType(const ELFDefinedAtom<ELFT> *atom) const {
- return atom->contentType();
- }
-
- virtual DefinedAtom::ContentType
- contentType(const Elf_Shdr *shdr, const Elf_Sym *sym) const {
- return DefinedAtom::typeZeroFill;
- }
-
- virtual DefinedAtom::ContentPermissions
- contentPermissions(const ELFDefinedAtom<ELFT> *atom) const {
- return atom->permissions();
- }
-
- virtual int64_t getType(const Elf_Sym *sym) const {
- return llvm::ELF::STT_NOTYPE;
- }
-
- virtual ~TargetAtomHandler() {}
-};
-
template <class ELFT> class TargetRelocationHandler {
public:
virtual error_code
applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
const lld::AtomLayout &, const Reference &) const = 0;
- virtual int64_t relocAddend(const Reference &)const { return 0; }
-
virtual ~TargetRelocationHandler() {}
};
@@ -99,9 +67,6 @@ public:
/// TargetLayout
virtual TargetLayout<ELFT> &targetLayout() = 0;
- /// TargetAtomHandler
- virtual TargetAtomHandler<ELFT> &targetAtomHandler() = 0;
-
virtual const TargetRelocationHandler<ELFT> &getRelocationHandler() const = 0;
/// Create a set of Default target sections that a target might needj
@@ -127,6 +92,10 @@ public:
virtual LLD_UNIQUE_BUMP_PTR(DynamicSymbolTable<ELFT>)
createDynamicSymbolTable() = 0;
+ virtual std::unique_ptr<Reader> getObjReader(bool) = 0;
+
+ virtual std::unique_ptr<Reader> getDSOReader(bool) = 0;
+
protected:
ELFLinkingContext &_context;
};
OpenPOWER on IntegriCloud