diff ticoff/disasm.c @ 117:f9fde7f36ae3

tiobjd: Thumb_BL reloc handling
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 03 Apr 2014 07:16:20 +0000
parents ca8e43288836
children 193926ccd1ec
line wrap: on
line diff
--- a/ticoff/disasm.c	Thu Apr 03 07:00:08 2014 +0000
+++ b/ticoff/disasm.c	Thu Apr 03 07:16:20 2014 +0000
@@ -136,8 +136,14 @@
 			   printf("MISALIGNED pos in CODE16 state, aborting\n");
 				return;
 			}
-			/* reloc handling to be added */
-			if (headroom >= 4 && thumb_check_bl(sec, pos))
+			if (rel) {
+				if (rel->type != RTYPE_THUMB_BL) {
+			printf("Wrong reloc type in CODE16 state, aborting\n");
+					return;
+				}
+				thumb_bl_reloc(sec, rel);
+				incr = 4;
+			} else if (headroom >= 4 && thumb_check_bl(sec, pos))
 				incr = 4;
 			else {
 				thumb_disasm_line(sec, pos);