3 ms·
> Here's an option for function symbols: when A is used for the first time, write a stub for A to the final binary and call that. When a definition for A is see
by wyldfire 5y ago
> Here's an option for function symbols: when A is used for the first time, write a stub for A to the final binary and call that. When a definition for A is seen, patch the stub to jump to the definition
Sorta like the trampolines linker will insert if it can't reach the code.
Symbol resolution has lots of complicated rules. But I suppose if we are designing a new system we aren't bound to those.
I would suggest that, relative to this new link-less compilation, the baseline link behavior should be considered like a static optimization that trades off static build time against code size and execution performance.