Recently, Norm Dresner wrote:
> I don't know which operations resulted in the function calls you have,
> but there are three possible (generic) solutions to the problem:
> 1. Remove the offending operations from the source (not your
> first choice, I'm sure)
> 2. Include in the link the entire gcc library; it can be done,
> but it's not wise
I would like to read a discourse on why this is not wise. It is the
method we have been using for the past two years with no trouble. This
approach also moves the burden for figuring out which modules need to be
linked to the linker.
> 3. (Most recommended, at least by me) Extract from the gcc
> library the routines you need to satisfy the unresolved symbols you
> have (and, recursively, any that they require as well) and link these
> few modules into your device driver/module.
>
> On my (RedHat 6.2-derived) system, the library is located at
>
> /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/libgcc.a
> The simple way to locate it is to do a search with find for the
> file libgcc.a
> find /usr/lib -name libgcc.a -print
Actually, the simplest way to find it is to let gcc tell you where
it is:
gcc -print-libgcc-file-name
I use this in a Makefile with:
LIBGCC := $(shell $(CC) -print-libgcc-file-name)
And on the LD line:
$(LD) -r -o my_module.o $(OBJS) $(LIBPATHS) -static $(LIBS) ${LIBGCC}
> Once you locate it, you can use ar to list the contents of the
> library and to "extract" (really a copy-out, not a removal) single
> modules from it. Then put these into your link
Yep, that will work. You can also just link to the whole library if
you do not have strict memory constraints. On my system the libgcc.a
library adds about 800KB to the size of the module.
Alternatively, you could set your Makefile up to extract the correct
modules from the library and add them to your linkage line. That would save
you having the various library .o cruft laying around. Another option would
be to build your own library using the appropriate tools (ar, mostly) of
just the modules you need and put it somewhere special.
Regards,
Steve
--------------------------
Stephen D. Cohen
Engineering Manager
Xybion Sensor Positioning Systems
11528 53rd Street North
Clearwater, FL 33760
Voice: (727) 299-0150
Fax: (727) 299-0804
[EMAIL PROTECTED]
www.xybion.com
************************************************************************
THIS EMAIL, AND ANY ATTACHMENTS, CONTAINS CONFIDENTIAL AND PRIVILEGED INFORMATION
INTENDED FOR THE USE OF THE ADDRESSEE. IF YOU ARE NOT THE INTENDED RECIPIENT OR AN
AUTHORIZED REPRESENTATIVE OF THE RECIPIENT, DO NOT READ OR DISTRIBUTE THE CONTENTS OF
THIS EMAIL AND DELETE IT FROM YOUR SYSTEM. THIS EMAIL AND ALL ATTACHMENTS HAVE BEEN
SCANNED FOR VIRUSES AND ARE BELIEVED TO BE VIRUS FREE. HOWEVER, IT IS THE RECIPIENT'S
RESPONSIBILITY TO ENSURE THAT THEY ARE VIRUS FREE. XYBION DOES NOT ACCEPT ANY
RESPONSIBILITY FOR ANY LOSS OR DAMAGE ARISING IN ANY WAY FROM USE OF THIS EMAIL AND
ATTACHMENTS. XYBION ALSO DOES NOT ACCEPT RESPONSIBILITY FOR PERSONAL EMAIL OR EMAIL
NOT ASSOCIATED WITH ITS BUSINESS PURPOSES.
************************************************************************
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/