Skip to content

Commit

Permalink
runtime: do not put scheduler and GC code in the same section
Browse files Browse the repository at this point in the history
This allows dead code elimination and avoids linker errors with
-scheduler=leaking.
  • Loading branch information
aykevl authored and deadprogram committed Apr 20, 2020
1 parent efdb2e8 commit f00bb63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/scheduler_avr.S
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/runtime/scheduler_cortexm.S
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ tinygo_swapTask:
pop {pc}
#endif

.section .text.tinygo_scanCurrentStack
.global tinygo_scanCurrentStack
.type tinygo_scanCurrentStack, %function
tinygo_scanCurrentStack:
Expand Down

0 comments on commit f00bb63

Please sign in to comment.