This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Simple question about GCC segments


Lam Lee <lamlee@spawar.navy.mil> writes:

>     Does anyone know why I get the undefined references below  during link
> time?  I cannot use majority of the functions in stdlib, but the functions
> in string.h seem compiling okay.

> ld -o bt5mon.out start.o hwinit.o  bt5mon.o -lg -Tbt5mon.lnk
> c:/cygnus/bin/../lib/libg.a(strtol.o)(.text+0x10a):strtol.c: undefined
> reference
>  to `__umodsi3'

Yes.  The missing code is in libgcc.a.  Link with gcc instead of ld.
Gcc will make sure libgcc.a is always linked in (try `gcc -v' to see
what it is doing).

Good luck,

AG

-- 
Anthony Green                                               Cygnus Solutions
                                                       Sunnyvale, California


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]