Skip to content

Commit bc3484e

Browse files
authored
Mark __aeabi_lmul section as allocatable and executable (earlephilhower#722)
When using a linker script which does not provide a .time_critical. section that is marked "ax" and wrongly define PICO_INT64_OPS_IN_RAM=1 this would generate a malformed executable with strange runtime bugs in the worst case.
1 parent b7e82b6 commit bc3484e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/rp2_common/pico_int64_ops/pico_int64_ops_aeabi.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010

1111
#include "pico/asm_helper.S"
1212

13+
.macro int64_section name
1314
#if PICO_INT64_OPS_IN_RAM
14-
.section RAM_SECTION_NAME(__aeabi_lmul)
15+
.section RAM_SECTION_NAME(\name), "ax"
1516
#else
16-
.section SECTION_NAME(__aeabi_lmul)
17+
.section SECTION_NAME(\name), "ax"
1718
#endif
19+
.endm
20+
21+
int64_section __aeabi_lmul
22+
1823
wrapper_func __aeabi_lmul
1924
muls r1, r2
2025
muls r3, r0
@@ -41,4 +46,3 @@ wrapper_func __aeabi_lmul
4146
adcs r1, r2
4247
add r1, r12
4348
bx lr
44-

0 commit comments

Comments
 (0)