This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
undefined reference to __fixunssfdi, __ashldi3, __lshrdi3
- From: JJ <alchemistmba at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 22 Oct 2009 17:43:17 -0700
- Subject: undefined reference to __fixunssfdi, __ashldi3, __lshrdi3
Hi,
I'm trying to build a standalone binary. In the linking stage, I get
errors complaining that the following symbols are missing:
__fixunssfdi, __ashldi3, __lshrdi3
These look like standard C symbols. For this code, I've implemented
custom versions of the standard C functions I use - strcpy, printf,
sprintf etc. I provide the -static and -nostdlib option to the linker
to build the standalone binary.
cross-ld -static -nostdlib -T temp.ld -o standalone_program start.o abc.o xyz.o
..
: undefined reference to `__fixunssfdi'
..
: undefined reference to `__ashldi3'
..
: undefined reference to `__lshrdi3'
gmake: *** [standalone_program] Error 1
I've tried using g++ instead of the ld but that didn't help either.
If I add the optimization option -Os to the build, it complains about
an undefined reference to 'memset' in addition to the above symbols:
: undefined reference to `memset'
I'm using:
GNU ld version 2.15
gcc version 3.4.3
JJ