From f00bb6333076b590a70a73c235d8388882385316 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 15 Apr 2020 15:11:39 +0200 Subject: [PATCH] runtime: do not put scheduler and GC code in the same section This allows dead code elimination and avoids linker errors with -scheduler=leaking. --- src/runtime/scheduler_avr.S | 1 + src/runtime/scheduler_cortexm.S | 1 + 2 files changed, 2 insertions(+) diff --git a/src/runtime/scheduler_avr.S b/src/runtime/scheduler_avr.S index 6c2ec2fa..4e65654d 100644 --- a/src/runtime/scheduler_avr.S +++ b/src/runtime/scheduler_avr.S @@ -188,6 +188,7 @@ tinygo_switchToScheduler: // Return into the scheduler, as if tinygo_switchToTask was a regular call. ret +.section .text.tinygo_scanCurrentStack .global tinygo_scanCurrentStack .type tinygo_scanCurrentStack, %function tinygo_scanCurrentStack: diff --git a/src/runtime/scheduler_cortexm.S b/src/runtime/scheduler_cortexm.S index bdc08279..8a18b5cd 100644 --- a/src/runtime/scheduler_cortexm.S +++ b/src/runtime/scheduler_cortexm.S @@ -112,6 +112,7 @@ tinygo_swapTask: pop {pc} #endif +.section .text.tinygo_scanCurrentStack .global tinygo_scanCurrentStack .type tinygo_scanCurrentStack, %function tinygo_scanCurrentStack: