First, thanks to Dave and Daniel for taking the time to reply.
On Fri, 2007-08-03 at 11:06 -0400, Daniel Jacobowitz wrote: > crtbeginT.o is used for -static; crtbegin.o is used without -static. > I don't recall why they have to be different. So far as we can tell from looking at the linux versions, the only difference is that crtbeginT is calling register_frame_info_bases deregister_frame_info_bases I suspect that these are related to the exception frame walker, because if --static (therefore crtbeginT) is provided then --eh-frame-header is not applied by default. That is: I suspect that --static does not support exception frame walking. This smells like a Linux legacy issue that may not apply to us. Can anybody confirm or correct that guess? I think I need to understand the eh-frame support better. Where should I look for documentation on that? > > 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. I can try this, and I'll look at the docs on that. > 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. We are going to want to have the PIE and shared models later, so I don't want to disable those. At the moment all I am really trying to do is to get --static working correctly.