Skip to content

Commit f00bb63

Browse files
aykevldeadprogram
authored andcommitted
runtime: do not put scheduler and GC code in the same section
This allows dead code elimination and avoids linker errors with -scheduler=leaking.
1 parent efdb2e8 commit f00bb63

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/runtime/scheduler_avr.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ tinygo_switchToScheduler:
188188
// Return into the scheduler, as if tinygo_switchToTask was a regular call.
189189
ret
190190

191+
.section .text.tinygo_scanCurrentStack
191192
.global tinygo_scanCurrentStack
192193
.type tinygo_scanCurrentStack, %function
193194
tinygo_scanCurrentStack:

src/runtime/scheduler_cortexm.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ tinygo_swapTask:
112112
pop {pc}
113113
#endif
114114

115+
.section .text.tinygo_scanCurrentStack
115116
.global tinygo_scanCurrentStack
116117
.type tinygo_scanCurrentStack, %function
117118
tinygo_scanCurrentStack:

0 commit comments

Comments
 (0)