logoalt Hacker News

jespinoyesterday at 6:45 PM1 replyview on HN

Yes, there is some information that is written by the linker in the final data section of the binary, the itab, that is the interface table for the dynamic dispatching. AFAIK, it is done there because you need to know other packages structs and interfaces to have the whole picture and build that table, and that happens using the build cache.


Replies

frohyesterday at 7:59 PM

yes, the interface tables! that was the word I didn't remember. and that is some computation going on there not "just" merging sections, and, in a normal static linker, wiring exports to imports, and not pulling in unneeded definitions (dead code elimination).

the interface table computation is a golang speciality, a fascinating one.

and the implementation of interface magic is disturbingly not mentioned in the article.