mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-06 12:03:41 +00:00
2d61972475
Precise globals require a whole program optimization pass that is hard to support when building packages separately. This patch removes support for these globals by converting the last use (Linux) to use linker-defined symbols instead. For details, see: https://github.com/tinygo-org/tinygo/issues/2870
17 lines
520 B
Go
17 lines
520 B
Go
//go:build gc.conservative && (baremetal || tinygo.wasm)
|
|
// +build gc.conservative
|
|
// +build baremetal tinygo.wasm
|
|
|
|
package runtime
|
|
|
|
// This file implements markGlobals for all the files that don't have a more
|
|
// specific implementation.
|
|
|
|
// markGlobals marks all globals, which are reachable by definition.
|
|
//
|
|
// This implementation marks all globals conservatively and assumes it can use
|
|
// linker-defined symbols for the start and end of the .data section.
|
|
func markGlobals() {
|
|
markRoots(globalsStart, globalsEnd)
|
|
}
|