Linux MIPS Architecture development
 help / color / mirror / Atom feed
* "relocation truncated to fit: R_MIPS_CALL16"
@ 2006-04-23  3:02 zhuzhenhua
  2006-04-24  8:36 ` Niklaus
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zhuzhenhua @ 2006-04-23  3:02 UTC (permalink / raw)
  To: linux-mips

i want to write a mini bootloader for my board, so i need jump to c
code from asm code
but when i compile and ld, i get "relocation truncated to fit:
R_MIPS_CALL16" messages for every function call..
i have try the mips_4KCle-gcc(worked for u-boot),
mips_fp_le-gcc(worked for mvita linux), and also a
mipsel-linux-gcc(worked for my linux 2.6 kernel), but they all failed,
even i add -G0 to gcc.
and i only compile success by using mips-elf-gcc under cygwin.
does it be caused by binutils version? or gcc compile CFLAGS?
thanks for any hints

Best Regards

Zhuzhenhua

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "relocation truncated to fit: R_MIPS_CALL16"
  2006-04-23  3:02 "relocation truncated to fit: R_MIPS_CALL16" zhuzhenhua
@ 2006-04-24  8:36 ` Niklaus
  2006-04-24  8:45 ` Nigel Stephens
  2006-04-24 10:09 ` Ralf Baechle
  2 siblings, 0 replies; 4+ messages in thread
From: Niklaus @ 2006-04-24  8:36 UTC (permalink / raw)
  To: zhuzhenhua; +Cc: linux-mips

On 4/23/06, zhuzhenhua <zzh.hust@gmail.com> wrote:
> i want to write a mini bootloader for my board, so i need jump to c
> code from asm code
> but when i compile and ld, i get "relocation truncated to fit:
> R_MIPS_CALL16" messages for every function call..
I had this error sometime back.
I increased the size of ROM0 and RAM0 in linker script which was used by ld.

I initially had problem using mips-linux-gcc(only for linux userspace
application) toolchain, when i used the target mips-elf-gcc(this one
should be used) i got around it.

> i have try the mips_4KCle-gcc(worked for u-boot),
> mips_fp_le-gcc(worked for mvita linux), and also a
> mipsel-linux-gcc(worked for my linux 2.6 kernel), but they all failed,
> even i add -G0 to gcc.
> and i only compile success by using mips-elf-gcc under cygwin.
> does it be caused by binutils version? or gcc compile CFLAGS?
> thanks for any hints
>
> Best Regards
>
> Zhuzhenhua
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "relocation truncated to fit: R_MIPS_CALL16"
  2006-04-23  3:02 "relocation truncated to fit: R_MIPS_CALL16" zhuzhenhua
  2006-04-24  8:36 ` Niklaus
@ 2006-04-24  8:45 ` Nigel Stephens
  2006-04-24 10:09 ` Ralf Baechle
  2 siblings, 0 replies; 4+ messages in thread
From: Nigel Stephens @ 2006-04-24  8:45 UTC (permalink / raw)
  To: zhuzhenhua; +Cc: linux-mips



zhuzhenhua wrote:
> i want to write a mini bootloader for my board, so i need jump to c
> code from asm code
> but when i compile and ld, i get "relocation truncated to fit:
> R_MIPS_CALL16" messages for every function call..
> i have try the mips_4KCle-gcc(worked for u-boot),
> mips_fp_le-gcc(worked for mvita linux), and also a
> mipsel-linux-gcc(worked for my linux 2.6 kernel), but they all failed,
> even i add -G0 to gcc.
> and i only compile success by using mips-elf-gcc under cygwin.
> does it be caused by binutils version? or gcc compile CFLAGS?
> thanks for any hints
>   

This is probably because the mips-linux configuration of gcc is 
generating position-independent code by default, whereas the mips-elf 
version doesn't.

Try adding the options "-mno-abicalls -fno-pic" to your mips-liinux-gcc 
options.

HTH

Nigel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "relocation truncated to fit: R_MIPS_CALL16"
  2006-04-23  3:02 "relocation truncated to fit: R_MIPS_CALL16" zhuzhenhua
  2006-04-24  8:36 ` Niklaus
  2006-04-24  8:45 ` Nigel Stephens
@ 2006-04-24 10:09 ` Ralf Baechle
  2 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2006-04-24 10:09 UTC (permalink / raw)
  To: zhuzhenhua; +Cc: linux-mips

On Sun, Apr 23, 2006 at 11:02:46AM +0800, zhuzhenhua wrote:

> i want to write a mini bootloader for my board, so i need jump to c
> code from asm code
> but when i compile and ld, i get "relocation truncated to fit:
> R_MIPS_CALL16" messages for every function call..
> i have try the mips_4KCle-gcc(worked for u-boot),
> mips_fp_le-gcc(worked for mvita linux), and also a
> mipsel-linux-gcc(worked for my linux 2.6 kernel), but they all failed,
> even i add -G0 to gcc.
> and i only compile success by using mips-elf-gcc under cygwin.
> does it be caused by binutils version? or gcc compile CFLAGS?
> thanks for any hints

PIC code.  Use -fno-pic -mno-abicalls.

  Ralf

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-24 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-23  3:02 "relocation truncated to fit: R_MIPS_CALL16" zhuzhenhua
2006-04-24  8:36 ` Niklaus
2006-04-24  8:45 ` Nigel Stephens
2006-04-24 10:09 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox