Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: include/llvm/Target/TargetELFWriterInfo.h

Issue 4295001: arm-mc-elf-s07-tew (Closed)
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/CodeGen/ELFWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Target/TargetELFWriterInfo.h
===================================================================
--- a/include/llvm/Target/TargetELFWriterInfo.h
+++ b/include/llvm/Target/TargetELFWriterInfo.h
@@ -14,11 +14,14 @@
#ifndef LLVM_TARGET_TARGETELFWRITERINFO_H
#define LLVM_TARGET_TARGETELFWRITERINFO_H
+#include "llvm/System/DataTypes.h"
+
namespace llvm {
class Function;
class TargetData;
class TargetMachine;
class MachineRelocation;
+ class TargetELFRelocHelper;
class BinaryObject;
//===--------------------------------------------------------------------===//
// TargetELFWriterInfo
@@ -119,8 +122,25 @@
/// final relocation value for this symbol.
virtual long int computeRelocation(unsigned SymOffset, unsigned RelOffset,
unsigned RelTy) const = 0;
+
+ // In certain architectures, nontrivial relocations require
+ // peeking into the actual instructions in the stream for patching
+ // purposes.
+
+ virtual TargetELFRelocHelper *getRelocHelper() const;
};
+ // This class isolates the arch-specific rules for
+ // emitting nontrivial intra-section relocations.
+ // This is a no-op in most architectures (e.g. x86)
+ // This class is NOT a no-op in ARM/ELF
+ class TargetELFRelocHelper {
+ public:
+ virtual ~TargetELFRelocHelper();
+ virtual void RelocateField(BinaryObject &BO, uint32_t Offset,
+ int64_t Value, unsigned Size,
+ const MachineRelocation &MR);
+ };
} // end llvm namespace
#endif // LLVM_TARGET_TARGETELFWRITERINFO_H
« no previous file with comments | « no previous file | lib/CodeGen/ELFWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698