]> git.wh0rd.org Git - elf2flt.git/commitdiff
elf2flt: fix relocation support for R_ARM_TARGET types
authorGreg Ungerer <gerg@linux-m68k.org>
Fri, 19 Aug 2016 13:49:51 +0000 (23:49 +1000)
committerGreg Ungerer <gerg@linux-m68k.org>
Thu, 25 Aug 2016 01:09:20 +0000 (11:09 +1000)
R_ARM_TARGET1 (and I think R_ARM_TARGET2) relocation types should be
treated in the same way as R_ARM_ABS32. Fix them to write out the addend
to the flat binary in network byte order.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
elf2flt.c

index 5ae7dd9e5ca4e84fc9f4f21e79496488f28e0fd4..3f315698ed00cf9f948a473eaaaeac81ec8c8a41 100644 (file)
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -1505,7 +1505,9 @@ DIS29_RELOCATION:
                                        (((*p)->howto->type != R_ARM_PC24) &&
                                        ((*p)->howto->type != R_ARM_PLT32)))
                                        tmp.c[i3] = (hl >> 24) & 0xff;
-                               if ((*p)->howto->type == R_ARM_ABS32)
+                               if (((*p)->howto->type == R_ARM_ABS32) ||
+                                   ((*p)->howto->type == R_ARM_TARGET1) ||
+                                   ((*p)->howto->type == R_ARM_TARGET2))
                                        *(uint32_t *)r_mem = htonl(hl);
                                else
                                        *(uint32_t *)r_mem = tmp.l;