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

Unified Diff: src/IceFixups.h

Issue 828873002: Subzero: Start writing out some relocation sections (text) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: review fixes Created 5 years, 11 months 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 | « src/IceELFSection.cpp ('k') | src/IceFixups.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceFixups.h
diff --git a/src/IceFixups.h b/src/IceFixups.h
index 7144aa8d093355e5b9d3c7cc942112d4ba5d4db3..b52572fbd20eafc7e65350f7e99eb15c58c38a24 100644
--- a/src/IceFixups.h
+++ b/src/IceFixups.h
@@ -14,19 +14,39 @@
#ifndef SUBZERO_SRC_ICEFIXUPS_H
#define SUBZERO_SRC_ICEFIXUPS_H
-#include "IceTypes.def"
+#include "IceDefs.h"
namespace Ice {
-enum FixupKind {
- // Specify some of the most common relocation types.
- FK_Abs_4 = 0,
- FK_PcRel_4 = 1,
+// Each target and container format has a different namespace of relocations.
+// This holds the specific target+container format's relocation number.
+typedef uint32_t FixupKind;
- // Target specific relocation types follow this.
- FK_FirstTargetSpecific = 1 << 4
+// Assembler fixups are positions in generated code/data that hold relocation
+// information that needs to be processed before finalizing the code/data.
+struct AssemblerFixup {
+public:
+ intptr_t position() const { return position_; }
+ void set_position(intptr_t Position) { position_ = Position; }
+
+ FixupKind kind() const { return kind_; }
+ void set_kind(FixupKind Kind) { kind_ = Kind; }
+
+ RelocOffsetT offset() const;
+ IceString symbol(const GlobalContext *Ctx) const;
+ void set_value(const Constant *Value) { value_ = Value; }
+
+ void emit(GlobalContext *Ctx) const;
+
+private:
+ intptr_t position_;
+ FixupKind kind_;
+ const Constant *value_;
};
+typedef std::vector<AssemblerFixup> FixupList;
+typedef std::vector<AssemblerFixup *> FixupRefList;
+
} // end of namespace Ice
#endif // SUBZERO_SRC_ICEFIXUPS_H
« no previous file with comments | « src/IceELFSection.cpp ('k') | src/IceFixups.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698