--- a\tccpe.c	Tue Apr 13 18:30:00 2010
+++ b\mod\tccpe.c	Fri Apr 16 12:04:35 2010
@@ -1244,11 +1244,18 @@
 
                     offset = text_section->data_offset;
                     /* add the 'jmp IAT[x]' instruction */
+#ifdef TCC_TARGET_ARM
+                    DWORD *pdw;
+                    pdw = section_ptr_add(text_section, 8+4);
+                    *pdw = 0xE59FC000;
+                    *(pdw+1) = 0xE59CF000;
+#else
                     p = section_ptr_add(text_section, 8);
                     *p = 0x25FF;
 #ifdef TCC_TARGET_X86_64
                     *(DWORD*)(p+1) = (DWORD)-4;
 #endif
+#endif
                     /* add a helper symbol, will be patched later in
                        pe_build_imports */
                     sprintf(buffer, "IAT.%s", name);
@@ -1256,8 +1263,13 @@
                         symtab_section, 0, sizeof(DWORD),
                         ELFW_ST_INFO(STB_GLOBAL, STT_OBJECT),
                         0, SHN_UNDEF, buffer);
+#ifdef TCC_TARGET_ARM
+                    put_elf_reloc(symtab_section, text_section, 
+                        offset + 8, R_XXX_THUNKFIX, is->iat_index);
+#else
                     put_elf_reloc(symtab_section, text_section, 
                         offset + 2, R_XXX_THUNKFIX, is->iat_index);
+#endif
                     is->thk_offset = offset;
                 }
 
@@ -1822,9 +1834,9 @@
             pe.subsystem = s1->pe_subsystem;
         else
 #if defined(TCC_TARGET_ARM)
-            pe.subsystem = 3;
-#else
             pe.subsystem = 9;
+#else
+            pe.subsystem = 3;
 #endif
         /* set default file/section alignment */
 	if (pe.subsystem == 1) {
