w6a: branch labels stay out of the symtab (isglobal wired)

Every interned symbol -- including branch labels defined via
p.label -- was emitted STB_GLOBAL, so labels were collide-able
across objects and the header's "GLOBAL symbols only" contract was
enforced nowhere (asym.isglobal was set but never read). Labels
stay interned for fixup resolution; the symtab now carries only
exported definitions, undefined externs, and reloc-referenced syms
(a reloc pre-pass marks those). rt/ensure.o drops from 15 emitted
syms to 2. Bootstrap 991-995 hold byte-identical on the new format.
This commit is contained in:
2026-08-09 01:07:19 +09:00
parent 06c40a8bef
commit 4fe2e25da4
4 changed files with 29 additions and 4 deletions

View File

@@ -50,7 +50,8 @@ struct Asym {
int defined; /* 1 if we own its address */
int is_text; /* if 1, address is in .text */
int is_data; /* if 1, address is in .data (mutually exclusive with is_text) */
int is_global; /* exported (TEXT) */
int is_global; /* exported (TEXT/DATA/DATAW) */
int has_reloc; /* referenced by a relocation — must be in the symtab */
u64 addr; /* offset within section if defined */
int idx; /* ELF symtab index, filled at emit time */
Asym *next;