This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: relocation truncated to fit errors


On 4/3/06, Marius Groeger <mgroeger@sysgo.com> wrote:
> 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
Yes target was mips-deb-linux.
What other targets does it support or do you recommend. I know that it
supports mips64 .

> 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).

Good piece of information.  I tried writing a hello world program and
few others , it compiled file and i got the a.out. file showed it as
an mips executable.

How do we provide the global pointer _gp.

>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 am not very sure about this. Can you tell me where i can find more
details about this.

> 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.
How to check this if they are compatible.

I thought the error was in the linker script but wasn't very sure.

Thanks very much for the help and handholding so far.

--
For unsubscribe information see http://sourceware.org/lists.html#faq


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