I\'ve read related questions like this and this, and other pages, but they don\'t really answer my question.
Basically, I see code like the following.
The spec doesn't specify how to link a program together or to external libraries, or building libraries, or frankly anything to do with the linker other than which symbols are visible across translation units.
The implementation is free to, and responsible for, implementing all that how they want, even through language extension. Anything with two underscores is implementation assigned. So everything about what's going on there is legal, and you'll not find it anywhere in the spec.