BR3392232: Fix relocations in MachO64
authorKeith Kanios <keith@kanios.net>
Wed, 28 Nov 2012 16:05:20 +0000 (28 20:05 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Wed, 28 Nov 2012 16:05:20 +0000 (28 20:05 +0400)
Signed-off-by: Keith Kanios <keith@kanios.net>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output/outmac64.c

index b26ff24..358ae6e 100644 (file)
@@ -580,7 +580,7 @@ static void macho_output(int32_t secto, const void *data,
 
     case OUT_REL4ADR:
         p = mydata;
-               WRITELONG(p, *(int64_t *)data);
+        WRITELONG(p, *(int64_t *)data + 4 - size);
 
         if (section == secto)
             nasm_error(ERR_PANIC, "intra-section OUT_REL4ADR");