relocation truncated to fit errors

Marius Groeger
Mon Apr 3 07:01:00 GMT 2006

On Sat, 1 Apr 2006, Niklaus wrote:

> I setup cross compilation environment for mips and did a make . Why do
> i get the last following error relocation truncated to fit errors.
> mips-deb-linux-gcc  -msoft-float -mgp32 -g -O2 -mips3 -G 0  -DGDB_STUB
> -I. -I./include  -I./config/mips3/vr4131 -I./config/mips3 -nostdlib 
> -T ./config/mips3/vr4131/vr4131_elf_gdb.ld -o jsp \
>                         exception_vector.o  sample1.o     timer.o
> serial.o logtask.o log_output.o vasyslog.o t_perror.o strerror.o 
> kernel_cfg.o   libkernel.a   -lgcc

What exact --configure target did you use for your cross compiler? It looks
like you've been using mips-linux or mips64-linux. Now, by selecting this
target, you'll get a libgcc which is compiled with -fPIC. Such a libgcc is
meant to be used in Linux userspace and will require a proper initialisation
of the global pointer (symbol _gp IIRC). I'm not sure you're providing that.
What's more, I think it'll also require the main program components be
linked with -fPIC as well, which you are not doing.

I'm aware that this is no directly usable help for you. All I can advise is
to carefully analyse (X-objdump -fph .. and X-objdump -d ..) ALL objects
you're linking to make sure they're compatible with each other.


Marius Groeger <>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10 | | |

For unsubscribe information see

More information about the crossgcc mailing list