summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/impl/ELFObject.hxx8
-rw-r--r--lib/MemChunk.cpp2
2 files changed, 8 insertions, 2 deletions
diff --git a/include/impl/ELFObject.hxx b/include/impl/ELFObject.hxx
index b1b51e4..bde835b 100644
--- a/include/impl/ELFObject.hxx
+++ b/include/impl/ELFObject.hxx
@@ -379,12 +379,16 @@ relocateMIPS(void *(*find_sym)(void *context, char const *name),
case R_MIPS_HI16:
A = A & 0xFFFF;
- *inst |= (((S + A + 0x8000) >> 16) & 0xFFFF);
+ // FIXME: We just support addend = 0.
+ rsl_assert(A == 0 && "R_MIPS_HI16 addend is not 0.");
+ *inst |= (((S + 0x8000) >> 16) & 0xFFFF);
break;
case R_MIPS_LO16:
A = A & 0xFFFF;
- *inst |= ((S + A) & 0xFFFF);
+ // FIXME: We just support addend = 0.
+ rsl_assert(A == 0 && "R_MIPS_LO16 addend is not 0.");
+ *inst |= (S & 0xFFFF);
break;
case R_MIPS_26:
diff --git a/lib/MemChunk.cpp b/lib/MemChunk.cpp
index 5c9a873..5a5cdbe 100644
--- a/lib/MemChunk.cpp
+++ b/lib/MemChunk.cpp
@@ -31,6 +31,8 @@
// define it as zero, so that it won't manipulate the flags.
#endif
+#define USE_FIXED_ADDR_MEM_CHUNK 1
+
#if USE_FIXED_ADDR_MEM_CHUNK
static uintptr_t StartAddr = 0x7e000000UL;
#endif