On Fri, Aug 03, 2007 at 10:47:44AM -0400, Jonathan S. Shapiro wrote: > 1. Versions of crtbegin > > There are three versions of crtbegin: crtbegin.o, crtbeginS.o, > crtbeginT.o. 'S' is for shared/PIE -- I understand about that. Can > somebody explain what the distinction is between crtbeginT.o and > crtbegin.o?
crtbeginT.o is used for -static; crtbegin.o is used without -static. I don't recall why they have to be different. > 2. Is there a simple way to configure the compiler so that the default > compilation model (in the absence of command-line directives) is > --static? If not, which of the various specfile macros need to be > updated? I know how to write specfile lines, I just want to make sure > that I don't miss one somewhere. Like Dave I recommend DRIVER_SELF_SPECS. Or you can just not put shared libraries in your default linker search path; that's basically equivalent. > 3. At least on i386, there are GOT sections appearing in > crt{begin,end}.o and libgcc.a. Our target does not have any dynamic > linking/loading support AT ALL. Are these sections fully resolved after > link time? Yes. But it sounds like you are modelling after the wrong target, a Linux one when you should be using an ELF one as base instead. You don't need three CRT files or a separate -static option if you don't have dynamic linking. And then you don't need to build libgcc with PIC code in it, and there won't be GOT references any more. -- Daniel Jacobowitz CodeSourcery