Skip to contentSkip to conversation

flatload: fix non-GOT relocations

PATCH Superseded Corey J. Boyle 2 participants 3 messages Oct 4, 2013 – Oct 5, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flatload: fix non-GOT relocations

From: "Corey J. Boyle" <[email protected]>

Use target address rather than host address when performing non-GOT relocations

---
 linux-user/flatload.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/flatload.c +2 -2
index 58f679e..c13a201 100644
@@ -44,7 +44,7 @@
 #define ntohl(x) be32_to_cpu(x)
 #include <target_flat.h>
 
-//#define DEBUG
+#define DEBUG
 
 #ifdef DEBUG
 #define	DBG_FLT(...)	printf(__VA_ARGS__)
@@ -633,7 +633,7 @@ static int load_flat_file(struct linux_binprm * bprm,
             /* Get the pointer's value.  */
             if (get_user_ual(addr, rp))
                 return -EFAULT;
-            addr = flat_get_addr_from_rp(rp, relval, flags, &persistent);
+            addr = flat_get_addr_from_rp(addr, relval, flags, &persistent);
             if (addr != 0) {
                 /*
                  * Do the relocation.  PIC relocs in the data section are
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 15 lines · Corey J. Boyle

From: "Corey J. Boyle" <[email protected]>

Use target address rather than host address when performing non-GOT relocations

---
 linux-user/flatload.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/flatload.c +0 -0
index 58f679e..c13a201 100644

linux-user/flatload.c line 47

Quoted 5 lines
linux-user/flatload.c +1 -1
@@ -44,7 +44,7 @@
 #define ntohl(x) be32_to_cpu(x)
 #include <target_flat.h>
 
-//#define DEBUG
+#define DEBUG

I assume you didn't mean to leave debugging enabled...

thanks
-- PMM

#2 lore raw
Quoted 19 lines · Peter Maydell
Quoted 18 lines · Corey J. Boyle

From: "Corey J. Boyle" <[email protected]>

Use target address rather than host address when performing non-GOT relocations

---
 linux-user/flatload.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux-user/flatload.c +0 -0
index 58f679e..c13a201 100644
@@ -44,7 +44,7 @@
 #define ntohl(x) be32_to_cpu(x)
 #include <target_flat.h>
 
Quoted 6 lines

linux-user/flatload.c line 47

Quoted 2 lines
linux-user/flatload.c +1 -1
-//#define DEBUG
+#define DEBUG

I assume you didn't mean to leave debugging enabled...

No, I didn't mean for that to stick around. I'll upload a new patch.

Thanks
Corey