[PATCH] [lld][ELF] Add TargetRelocationHandler
Michael Spencer
bigcheesegs at gmail.com
Tue Jan 29 17:52:19 PST 2013
Hi shankarke, khemant,
http://llvm-reviews.chandlerc.com/D347
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D347?vs=817&id=818#toc
Files:
lib/ReaderWriter/ELF/DefaultTargetHandler.h
lib/ReaderWriter/ELF/TargetHandler.h
Index: lib/ReaderWriter/ELF/DefaultTargetHandler.h
===================================================================
--- lib/ReaderWriter/ELF/DefaultTargetHandler.h
+++ lib/ReaderWriter/ELF/DefaultTargetHandler.h
@@ -45,6 +45,10 @@
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() {}
Index: lib/ReaderWriter/ELF/TargetHandler.h
===================================================================
--- lib/ReaderWriter/ELF/TargetHandler.h
+++ lib/ReaderWriter/ELF/TargetHandler.h
@@ -16,21 +16,25 @@
#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/Core/TargetInfo.h"
#include "lld/ReaderWriter/ELFTargetInfo.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/Support/FileOutputBuffer.h"
#include <memory>
#include <vector>
#include <unordered_map>
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;
@@ -57,6 +61,13 @@
}
};
+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 {
@@ -102,6 +113,8 @@
/// 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D347.2.patch
Type: text/x-patch
Size: 2252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130129/c9653855/attachment.bin>
More information about the llvm-commits
mailing list