hidden symbol `__divdi3' is referenced by DSO

Shaun Jackman sjackman@gmail.com
Thu Dec 2 21:11:00 GMT 2004


My problem occurs not at run time, but at link time.

cc -nostdlib -L/home/sjackman/lib/newlib -Wl,-rpath
/home/sjackman/lib/newlib /home/sjackman/lib/newlib/crt0.o  hello.o 
-lc -lm -lgcc -o hello
/usr/bin/ld: hello: hidden symbol `__divdi3' in
/usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a(_divdi3.oS) is referenced
by DSO
collect2: ld returned 1 exit status

Cheers,
Shaun


On Thu, 02 Dec 2004 14:53:34 -0500, Jeff Johnston <jjohnstn@redhat.com> wrote:
> Works fine for me.
> 
> It looks like you need an rpath specified.  Try adding:
> 
> -Wl,-rpath /home/sjackman/lib/newlib
> 
> -- Jeff J.
> 
>
> Shaun Jackman wrote:
> > When trying to link "Hello, world!" with a native shared newlib
> > library, I get this hidden symbol error. The same application links
> > perfectly with -static.
> >
> > Thanks in advance for any help you can give.
> >
> > Please cc me in your reply. Cheers,
> > Shaun
> >
> > newlib 1.12.0 (CVS 2004-11-26)
> > gcc 3.3.4
> >
> > $ cc -g -O2 -W -Wall -Werror -I/home/sjackman/include/newlib -nostdlib
> > -L/home/sjackman/lib/newlib /home/sjackman/lib/newlib/crt0.o  hello.c
> > -lc -lm -lgcc -o hello
> > /usr/bin/ld: hello: hidden symbol `__divdi3' in
> > /usr/lib/gcc-lib/i486-linux/3.3.4/libgcc.a(_divdi3.oS) is referenced
> > by DSO
> > collect2: ld returned 1 exit status
> > make: *** [hello] Error 1
> > $ cc --version | head -1
> > cc (GCC) 3.3.4 (Debian 1:3.3.4-13)



More information about the Newlib mailing list