This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Some questions about ld script
- From: loody <miloody at gmail dot com>
- To: binutils at sourceware dot org
- Date: Fri, 26 Jun 2009 13:30:37 +0800
- Subject: 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