2 ms·
> how does a relatively high end language feature drop down to binary format? All high end language features drop down to binary formats -- that's what ABIs ar
by gumby 8y ago
> how does a relatively high end language feature drop down to binary format?
All high end language features drop down to binary formats -- that's what ABIs are.
In the case of things like constructors and destructors you can of course just stick them all in the text section and have the linker construct call to them in some fashion. You'd have to use some reserved name mangling to distinguish them so that the linker can even find them.
If instead you have separate sections the linker can just run through the symbol table; the dynamic loader can even do so so the compile-time linker can ignore those sections (just copy them). You can even play tricks like unloading them after running (or only load exit code upon exit) if memory games like that matter. etc etc.
It's all about how you communicate semantic issues from compile time to run time, as with all ABI issues.