[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] RE: internal error: out of range error ( Theodore A.

From: Dave Hylands
Subject: RE: [avr-gcc-list] RE: internal error: out of range error ( Theodore A. Roth)
Date: Mon, 13 Sep 2004 09:52:38 -0700

Hi Ted,

> Maybe I'm missing something, but I don't understand why (or 
> how) you are using the linker to build your libraries. The 
> object files are already relocatable, stuffing them into the 
> lib archive shouldn't change that. So, it seems to me that 
> you are trying to build a relocatable executable instead of 
> a library.

I'm not sure if this is what Robert is doing, but you can use the linker
to take in a bunch of partially linked object files and spit out another
partially linked object file (see the -r option for ld).

The advantage (and disadvantage) of this approach is that EVERYTHING is
linked in. When you use ar produced libraries, the linker only pulls in
what it needs to resolve symbols. When you use -r with ld, the linker
pulls together ALL of the objects passed in on the command line.

Linux uses this approach extensively when building the kernel. It makes
self-registering code much easier. Nobody has to have a reference to a
driver to cause it to be initialized, it includes it's own "constructor"
entry which is called because all of the objects are forced in.

Dave Hylands
Vancouver, BC, Canada

reply via email to

[Prev in Thread] Current Thread [Next in Thread]