# HG changeset patch # User Michael Spacefalcon # Date 1396507807 0 # Node ID 2f23301d2f8653e728f3272c5d41cde3626ce7f4 # Parent ca8e4328883642dabc4d5843d01ea947f962a406 tiobjd: literal reloc recognition restricted to RTYPE_LONG diff -r ca8e43288836 -r 2f23301d2f86 ticoff/armdis.c --- a/ticoff/armdis.c Thu Apr 03 06:42:39 2014 +0000 +++ b/ticoff/armdis.c Thu Apr 03 06:50:07 2014 +0000 @@ -11,7 +11,7 @@ #include "globals.h" extern unsigned get_u16(), get_u32(); -extern struct internal_reloc *find_reloc(); +extern struct internal_reloc *find_word32_reloc(); extern char *regnames[16], *condition_decode[16], *shift_types[4]; @@ -247,7 +247,7 @@ if (litoff >= sec->size) return(0); /* all checks passed, proceed */ - rel = find_reloc(sec, litoff); + rel = find_word32_reloc(sec, litoff); switch (size) { case 1: datum = filemap[sec->data_offset + litoff]; diff -r ca8e43288836 -r 2f23301d2f86 ticoff/reloc.c --- a/ticoff/reloc.c Thu Apr 03 06:42:39 2014 +0000 +++ b/ticoff/reloc.c Thu Apr 03 06:50:07 2014 +0000 @@ -141,3 +141,16 @@ } return(0); } + +struct internal_reloc * +find_word32_reloc(sec, loc) + struct internal_scnhdr *sec; + unsigned loc; +{ + struct internal_reloc *rel; + + rel = find_reloc(sec, loc); + if (rel && rel->type != RTYPE_LONG) + rel = 0; + return(rel); +} diff -r ca8e43288836 -r 2f23301d2f86 ticoff/thumbdis.c --- a/ticoff/thumbdis.c Thu Apr 03 06:42:39 2014 +0000 +++ b/ticoff/thumbdis.c Thu Apr 03 06:50:07 2014 +0000 @@ -11,7 +11,7 @@ #include "globals.h" extern unsigned get_u16(), get_u32(); -extern struct internal_reloc *find_reloc(); +extern struct internal_reloc *find_word32_reloc(); extern char *regnames[16], *condition_decode[16], *shift_types[4]; @@ -123,7 +123,7 @@ off += 4; litoff = off + loff; if (litoff+4 <= sec->size) { - rel = find_reloc(sec, litoff); + rel = find_word32_reloc(sec, litoff); datum = get_u32(filemap + sec->data_offset + litoff); printf("ldr\t%s, =", regnames[(word>>8)&7]); if (rel)