Re: [uCsimm] relocation truncated to fit: DISP16 printf

From: Erwin Authried (eauth@softsys.co.at)
Date: Thu Mar 23 2000 - 11:17:20 EST


Bobby_Lai@acer.com.tw wrote:
>
>
>
> First : I have use "-fPIC" as a part of CFLAGS of m68k-pic-coff-gcc.
> When I use "m68k-pic-coff-ld" to link all my objects code that my program
> need it,
> loader complain me with "relocation truncated ..... ".
>
> Second: I have wrote a program larger than 37k bytes execution code.
> It seems "bsr xxx" can not jump over 32767 bytes distance ....

Hi Bobby,

Of course it can't, that's why the 32bit PIC patch has been created ;-)

>
> I log a portion of loader message to you.
> Thank you in advance.
>
> m68k-pic-coff-ld --embedded-relocs -T ../arch/embed/user.ld
> ./arch/embed/crt0.o addrtest.stamp.embed.o ../version/stamp.embed.o
> addrtest.embed.o ../build/embed/mwinlib.a ../../uC-libc/libc.a
> /usr/local/gnu/lib/gcc-lib/m68k-pic-coff/2.7.2.2-pic-010298/libgcc.a -o
> ./build/embed/addrtest.coff && cp -f ../build/embed/addrtest.coff
> ./build/embed/addrtest.coff.bak && ../../coff2flt-0.3/coff2flt -o
> ./build/embed/addrtest ../build/embed/addrtest.coff
> ./arch/embed/crt0.o(.text+0x16):../arch/embed/crt0.S: relocation truncated
> to fit: DISP16 exit

You have to modify crt0.S, I have added the new version at http://www.home.at/uclinux now.

> ./build/embed/mwinlib.a(winmain.embed.)(.text+0x16):winmain.c: relocation
> truncated to fit: DISP16 exit
> ./build/embed/mwinlib.a(winmain.embed.)(.text+0x58):winmain.c: relocation
> truncated to fit: DISP16 exit
> ./build/embed/mwinlib.a(winmain.embed.)(.text+0x32e):winmain.c: relocation
> truncated to fit: DISP16 memset

Are you sure that you have compiled winmain.c with -fPIC?
If in doubt, create the assembler output. The calls to memset, exit, .... should
look like:

        lea memset-.-8,%a0
        jsr 0(%pc,%a0)

instead of

        bsr.w memset

Regards,

Erwin



This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:35 EST