flatload: fix non-GOT relocations
authorCorey J. Boyle <corey@kansanian.com>
Sat, 5 Oct 2013 11:46:31 +0000 (07:46 -0400)
committerRiku Voipio <riku.voipio@linaro.org>
Fri, 29 Nov 2013 08:58:37 +0000 (10:58 +0200)
Use target address rather than host address when performing
non-GOT relocations

Signed-off-by: Corey J. Boyle <corey@kansanian.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/flatload.c

index 58f679e..ceb89bb 100644 (file)
@@ -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