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


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

Some questions about ld script


Dear all:
I try to link my programs, *.o, as an standalone function call in dram
for me to jump to execute.
But I get the following error:
uart.c:(.text+0x6c): relocation truncated to fit: R_MIPS_GPREL16 against `suart1
_fcr'

I google the problem and find the problem comes from the branch target
is too far.
But my ld script is pretty simple, just put everything together as below:

OUTPUT_ARCH(mips)
SECTIONS
{
  .text 0xa0200000 :
  {
    * (.text)
    . = ALIGN(8);
  }
  .data :
  {
    *(.rodata)
    *(.data)
    . = ALIGN(8);
    *(.lit8)
    *(.lit4)
    *(.sdata)
    . = ALIGN(8);
  }

  . = ALIGN(4);
  _fbss = .;			/* Start of unitialised data	    */

  .sbss :
  {
    *(.sbss)
    *(.scommon)
  }
  .bss :
  {
    *(.bss)
    *(COMMON)
  }
  .gptab.sdata : { *(.gptab.data) *(.gptab.sdata) }
  .gptab.sbss : { *(.gptab.bss) *(.gptab.sbss) }

  /DISCARD/ :
  {
    *(.reginfo)
  }
}

Does the error come from ld script or my program?
appreciate your help,
miloody


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