I'm pretty sure the documentation actually lies though.
Yes, `collect2` exists, but with the existence of all the modern linker sections and scripts, it simply forwards everything to `ld` unchanged. There's no sneaky inspection, C code generation, or second linking pass.
Thanks for the clarification. I was questioning my sanity, because collect2 as described in the doc sounds not just hacky, but also like a waste of compile time.
Yes, `collect2` exists, but with the existence of all the modern linker sections and scripts, it simply forwards everything to `ld` unchanged. There's no sneaky inspection, C code generation, or second linking pass.