compiler: separate package exports from entry roots

This commit is contained in:
2026-08-12 21:59:51 +09:00
parent a88078faf8
commit fc4bde703e
15 changed files with 420 additions and 190 deletions

View File

@@ -101,12 +101,11 @@ main(int argc, char **argv)
}
Lnk l = {0};
/* Seed the symbol table with the entry point so archive pulls
* include the .o that defines it. Without this, a libwwrt.a
* containing start.o is silently skipped if no user .o
* references _start, and the entry falls back to main — which
* has no proper exit path. */
/* Seed both accepted entry symbols before archive loading. The root
* package archive then participates in the same selective member-pull
* protocol as every dependency; libwwrt.a still supplies _start. */
(void)l_intern(&l, "_start");
(void)l_intern(&l, "main");
for (int i = 0; i < ninputs; i++) {
if (l_load(&l, inputs[i]) != 0) return 1;
}