[lld] r173896 - [ELF] Add ELFTargetRelocationHandler.
Michael J. Spencer
bigcheesegs at gmail.com
Tue Jan 29 21:25:45 PST 2013
Author: mspencer
Date: Tue Jan 29 23:25:44 2013
New Revision: 173896
URL: http://llvm.org/viewvc/llvm-project?rev=173896&view=rev
Log:
[ELF] Add ELFTargetRelocationHandler.
Modified:
lld/trunk/lib/ReaderWriter/ELF/DefaultTargetHandler.h
lld/trunk/lib/ReaderWriter/ELF/TargetHandler.h
Modified: lld/trunk/lib/ReaderWriter/ELF/DefaultTargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DefaultTargetHandler.h?rev=173896&r1=173895&r2=173896&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DefaultTargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DefaultTargetHandler.h Tue Jan 29 23:25:44 2013
@@ -45,6 +45,10 @@ public:
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() {}
Modified: lld/trunk/lib/ReaderWriter/ELF/TargetHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/TargetHandler.h?rev=173896&r1=173895&r2=173896&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/TargetHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/TargetHandler.h Tue Jan 29 23:25:44 2013
@@ -16,6 +16,8 @@
#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"
@@ -23,6 +25,7 @@
#include "lld/ReaderWriter/ELFTargetInfo.h"
#include "llvm/ADT/Hashing.h"
+#include "llvm/Support/FileOutputBuffer.h"
#include <memory>
#include <vector>
@@ -31,6 +34,7 @@
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 @@ public:
}
};
+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 @@ public:
/// 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;
More information about the llvm-commits
mailing list