That's really a gcc question, but basically it boils down to this: collect2 looks at the objects, builds an additional object if needed (say, for ctor/dtor tables or whatnot), and invokes ld.