Index: emcore/trunk/export/emcoreapp.h |
— | — | @@ -8,6 +8,7 @@ |
9 | 9 | "ldr\tr2, [r0]\n\tcmp\tr3, r2\n\tldrls\tr1, [r0,#4]\n\tcmpls\tr1, r3\n\t" \
|
10 | 10 | "movhi\tr0, #0\n\tldrhi\tr1, =__emcore_incompatible_api_str\n\t" \
|
11 | 11 | "swihi\t1\n\tldr\tr1, =__emcore_syscall\n\tstr\tr0, [r1]\n\t" \
|
| 12 | + "b\t__emcore_entrypoint_c\n\t.ltorg\n__emcore_entrypoint_c:\n\t" \
|
12 | 13 | ::: "r0", "r1", "r2", "r3", "r12", "lr", "cc", "memory"); \
|
13 | 14 | thread_set_name(NULL, threadnamestr); \
|
14 | 15 | thread_set_priority(NULL, threadprio); \
|
Index: emcore/trunk/export/armhelpers.c |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | int __clzsi2(int arg) __attribute__((naked,noinline)); |
33 | 33 | int __clzsi2(int arg) |
34 | 34 | { |
35 | | - __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#8]\n\t"); |
| 35 | + __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#8]\n\t.ltorg\n\t"); |
36 | 36 | } |
37 | 37 | |
38 | 38 | // This one has a non-standard calling convention, so we just declare it as void |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | void __aeabi_idivmod(void) __attribute__((naked,noinline)); |
40 | 40 | void __aeabi_idivmod(void) |
41 | 41 | { |
42 | | - __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#0xc]\n\t"); |
| 42 | + __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#0xc]\n\t.ltorg\n\t"); |
43 | 43 | } |
44 | 44 | |
45 | 45 | // This one has a non-standard calling convention, so we just declare it as void |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | void __aeabi_uidivmod(void) __attribute__((naked,noinline)); |
47 | 47 | void __aeabi_uidivmod(void) |
48 | 48 | { |
49 | | - __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#0x10]\n\t"); |
| 49 | + __asm__ volatile("ldr\tr12, =__emcore_syscall\n\tldr\tr12, [r12]\n\tldr\tpc, [r12,#0x10]\n\t.ltorg\n\t"); |
50 | 50 | } |
51 | 51 | |
52 | 52 | extern __attribute__((alias("__aeabi_idivmod"))) void __aeabi_idiv(void); |
Index: emcore/trunk/export/emcorelib.h |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | int __emcore_lib_init() \
|
9 | 9 | { \
|
10 | 10 | asm volatile("swi\t2\n\tldr\tr1, =__emcore_syscall\n\tstr\tr0, [r1]\n\t" \
|
| 11 | + "b\t__emcore_lib_init_c\n\t.ltorg\n__emcore_lib_init_c:\n\t" \
|
11 | 12 | ::: "r0", "r1", "r2", "r3", "r12", "lr", "cc", "memory"); \
|
12 | 13 | if (__emcore_syscall->table_version < EMCORE_API_VERSION \
|
13 | 14 | || __emcore_syscall->table_minversion > EMCORE_API_VERSION) \
|