llvm_unreachable("Target should provide implementation for function ");
}
+ const TargetRelocationHandler<ELFT> &getRelocationHandler() const {
+ llvm_unreachable("Target should provide implementation for function ");
+ }
+
/// Create a set of Default target sections that a target might needj
void createDefaultSections() {}
#ifndef LLD_READER_WRITER_ELF_TARGET_HANDLER_H
#define LLD_READER_WRITER_ELF_TARGET_HANDLER_H
+#include "Layout.h"
+
#include "lld/Core/InputFiles.h"
#include "lld/Core/LinkerOptions.h"
#include "lld/Core/LLVM.h"
#include "lld/ReaderWriter/ELFTargetInfo.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/Support/FileOutputBuffer.h"
#include <memory>
#include <vector>
namespace lld {
namespace elf {
template <class ELFT> class ELFDefinedAtom;
+class ELFWriter;
template <class ELFT> class Header;
template <class ELFT> class Section;
template <class ELFT> class TargetLayout;
}
};
+template <class ELFT> class TargetRelocationHandler {
+public:
+ virtual ErrorOr<void> applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
+ const AtomLayout &,
+ const Reference &)const = 0;
+};
+
/// \brief An interface to override functions that are provided by the
/// the default ELF Layout
template <class ELFT> class TargetHandler : public TargetHandlerBase {
/// 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
virtual void createDefaultSections() = 0;