add fixup for uncompressed jumptable
authornotaz <notasas@gmail.com>
Mon, 9 Sep 2013 00:55:42 +0000 (03:55 +0300)
committernotaz <notasas@gmail.com>
Mon, 9 Sep 2013 00:55:42 +0000 (03:55 +0300)
.gitignore
Main.cpp

index ef3db36..59a1e23 100644 (file)
@@ -3,3 +3,4 @@ cyclone_gen
 Cyclone.s
 cscope.out
 tags
+tests/test_misc2.bin
index 9ef8a2b..13efac2 100644 (file)
--- a/Main.cpp
+++ b/Main.cpp
@@ -306,7 +306,12 @@ static void PrintFramework()
   ot("  bx lr\n");\r
   ltorg();\r
 #else\r
-  ot(";@ do nothing\n");\r
+  ot(";@ fix final jumptable entries\n");\r
+  ot("  ldr r12,=CycloneJumpTab\n");\r
+  ot("  add r12,r12,#0x10000*4\n");\r
+  ot("  ldr r0,[r12,#-3*4]\n");\r
+  ot("  str r0,[r12,#-2*4]\n");\r
+  ot("  str r0,[r12,#-1*4]\n");\r
   ot("  bx lr\n");\r
 #endif\r
   ot("\n");\r