|
1 | 1 | /* armclang_stubs.c |
2 | 2 | * |
3 | 3 | * C library glue for building wolfBoot with the ARM Compiler for Embedded |
4 | | - * (USE_ARMCLANG=1). Only used by the WOLFCRYPT_TZ/PKCS11 configurations. |
| 4 | + * (USE_ARMCLANG=1). |
5 | 5 | * |
6 | 6 | * - ARMCLANG_STUBS_MALLOC (secure image): heap allocator over the RAM_HEAP |
7 | | - * scatter region. The GNU build uses newlib-nano's malloc on top of the |
8 | | - * _sbrk hook in src/pkcs11_store.c; the ARM C library malloc cannot be |
9 | | - * used instead because it requires the C library runtime initialization |
10 | | - * (__rt_entry), which never runs since wolfBoot enters at isr_reset. |
| 7 | + * scatter region. We can't use the ARM C library malloc because it requires |
| 8 | + * the C library runtime initialization, which never runs since wolfBoot |
| 9 | + * enters at isr_reset. |
11 | 10 | * |
12 | 11 | * - ARMCLANG_STUBS_DEAD_REFS: trap stubs for symbols that are only |
13 | 12 | * referenced from sections that GNU ld garbage-collects; armlink needs |
|
39 | 38 | extern unsigned int _start_heap; |
40 | 39 | extern unsigned int _heap_size; |
41 | 40 |
|
42 | | -/* First-fit allocator with address-ordered free list and coalescing. |
43 | | - * Block header keeps the total block size (header included); blocks and |
44 | | - * payloads are 8-byte aligned. */ |
45 | 41 | struct heap_blk { |
46 | 42 | size_t size; |
47 | 43 | struct heap_blk *next; |
@@ -163,14 +159,6 @@ void *realloc(void *ptr, size_t size) |
163 | 159 |
|
164 | 160 | #ifdef ARMCLANG_STUBS_DEAD_REFS |
165 | 161 |
|
166 | | -/* Trap stubs for symbols that are referenced only from wolfSSL sections |
167 | | - * that are dead in the wolfBoot configurations (proven by the GNU builds, |
168 | | - * where the references would be a link error if the referencing sections |
169 | | - * survived garbage collection). armlink resolves all symbols before its |
170 | | - * unused section elimination, so the references need a definition; both |
171 | | - * the stubs and the referencing sections are eliminated from the image. |
172 | | - * The infinite loop makes any unexpected live call fail loudly. */ |
173 | | - |
174 | 162 | #define ARMCLANG_DEAD_REF_STUB(name) \ |
175 | 163 | void name(void); \ |
176 | 164 | void name(void) { while (1) ; } |
|
0 commit comments