runtime: precisely scan globals on all platforms

This commit is contained in:
Jake Bailey
2026-08-07 12:08:32 -07:00
committed by Ron Evans
parent ede501ae2b
commit 59fb104004
18 changed files with 136 additions and 324 deletions
+3
View File
@@ -1293,6 +1293,9 @@ func makeGlobalsModule(ctx llvm.Context, globals map[string]map[string]string, m
global := llvm.AddGlobal(mod, stringType, globalName)
global.SetInitializer(initializer)
global.SetAlignment(targetData.PrefTypeAlignment(stringType))
// Keep external linkage for module resolution. Hidden visibility permits internalization.
// See https://llvm.org/docs/LangRef.html#visibility-styles.
global.SetVisibility(llvm.HiddenVisibility)
}
}
+3 -3
View File
@@ -1,4 +1,4 @@
target package code rodata data bss
hifive1b examples/echo 4321 323 0 2268
microbit examples/serial 2842 382 8 2264
wioterminal examples/pininterrupt 8039 1669 132 7496
hifive1b examples/echo 4405 323 0 2268
microbit examples/serial 2922 382 8 2264
wioterminal examples/pininterrupt 8251 1717 148 7496