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

Unified Diff: src/assembler_ia32.cpp

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/assembler_ia32.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler_ia32.cpp
diff --git a/src/assembler_ia32.cpp b/src/assembler_ia32.cpp
index 8feb7fef3aef198302055a96b4706a522eed7e40..88ad7ef79aa03f60d58c3df20443797449d54175 100644
--- a/src/assembler_ia32.cpp
+++ b/src/assembler_ia32.cpp
@@ -25,25 +25,8 @@
namespace Ice {
namespace x86 {
-class DirectCallRelocation : public AssemblerFixup {
- DirectCallRelocation(const DirectCallRelocation &) = delete;
- DirectCallRelocation &operator=(const DirectCallRelocation &) = delete;
-
-public:
- static DirectCallRelocation *create(Assembler *Asm, FixupKind Kind,
- const Constant *Sym) {
- return new (Asm->Allocate<DirectCallRelocation>())
- DirectCallRelocation(Kind, Sym);
- }
-
-private:
- DirectCallRelocation(FixupKind Kind, const Constant *Sym)
- : AssemblerFixup(Kind, Sym) {}
-};
-
Address Address::ofConstPool(Assembler *Asm, const Constant *Imm) {
- AssemblerFixup *Fixup =
- x86::DisplacementRelocation::create(Asm, FK_Abs_4, Imm);
+ AssemblerFixup *Fixup = Asm->createFixup(llvm::ELF::R_386_32, Imm);
const RelocOffsetT Offset = 0;
return x86::Address::Absolute(Offset, Fixup);
}
@@ -127,7 +110,7 @@ void AssemblerX86::call(const ConstantRelocatable *label) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
intptr_t call_start = buffer_.GetPosition();
EmitUint8(0xE8);
- EmitFixup(DirectCallRelocation::create(this, FK_PcRel_4, label));
+ EmitFixup(this->createFixup(llvm::ELF::R_386_PC32, label));
EmitInt32(-4);
assert((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
(void)call_start;
@@ -2274,7 +2257,7 @@ void AssemblerX86::j(CondX86::BrCond condition,
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0x0F);
EmitUint8(0x80 + condition);
- EmitFixup(DirectCallRelocation::create(this, FK_PcRel_4, label));
+ EmitFixup(this->createFixup(llvm::ELF::R_386_PC32, label));
EmitInt32(-4);
}
@@ -2310,7 +2293,7 @@ void AssemblerX86::jmp(Label *label, bool near) {
void AssemblerX86::jmp(const ConstantRelocatable *label) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0xE9);
- EmitFixup(DirectCallRelocation::create(this, FK_PcRel_4, label));
+ EmitFixup(this->createFixup(llvm::ELF::R_386_PC32, label));
EmitInt32(-4);
}
« no previous file with comments | « src/assembler_ia32.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698