* Why "relocation truncated to fit" with this linker script?
@ 2007-10-31 0:55 Rick Mann
2007-10-31 2:26 ` Alan Modra
0 siblings, 1 reply; 3+ messages in thread
From: Rick Mann @ 2007-10-31 0:55 UTC (permalink / raw)
To: binutils
I get
arm-elf-g++ -Wl,-Map,mapfile.txt -Llib -Xlinker --gc-sections -Xlinker
--script=link.lds -o h.elf obj/start.o obj/vectors.o src/glue.o src/
Assert.o src/Graphics.o src/Interrupts.o src/Particle.o src/
ProcUtils.o src/Util.o src/lcd.o src/main.o src/pfd/AirData.o src/pfd/
GraphicsUtils.o src/pfd/MiscUtils.o src/pfd/graphics/Airspeed.o src/
pfd/graphics/Altitude.o src/pfd/graphics/HSI.o src/pfd/graphics/HSI2.o
src/pfd/graphics/Horizon.o src/pfd/graphics/Instrument.o src/pfd/
graphics/Rect.o src/pfd/graphics/Renderable.o src/pfd/graphics/
TapeDisplay.o -lgui64 -lm
obj/start.o: In function `loop':
(.text+0x4c): relocation truncated to fit: R_ARM_PC24 against symbol
`_init' defined in .init section in /usr/local/arm3/lib/gcc/arm-elf/
4.2.1/crti.o
obj/start.o: In function `loop':
(.text+0x54): relocation truncated to fit: R_ARM_PC24 against symbol
`_fini' defined in .fini section in /usr/local/arm3/lib/gcc/arm-elf/
4.2.1/crti.o
/usr/local/arm3/lib/gcc/arm-elf/4.2.1/crtbegin.o:(.fini+0x0):
relocation truncated to fit: R_ARM_PC24 against `__do_global_dtors_aux'
/usr/local/arm3/lib/gcc/arm-elf/4.2.1/crtbegin.o:(.init+0x0):
relocation truncated to fit: R_ARM_PC24 against `frame_dummy'
/usr/local/arm3/lib/gcc/arm-elf/4.2.1/crtend.o:(.init+0x0): relocation
truncated to fit: R_ARM_PC24 against `__do_global_ctors_aux'
collect2: ld returned 1 exit status
Even though my linker script puts start.o and .init & .fini sections
all together:
SECTIONS
{
. = 0x00000000;
. = ALIGN(4);
.text :
{
vectorsStart = .;
KEEP (obj/vectors.o(.text));
vectorsEnd = .;
}
. = 0x80008000;
. = ALIGN(4);
.text :
{
obj/start.o(.text);
src/Interrupts.o(.text);
}
. = ALIGN(4);
.text : { *(.text) }
. = ALIGN(4);
.init :
{
KEEP (*(.init))
} = 0
. = ALIGN(4);
.fini :
{
KEEP (*(.fini))
} = 0
If I remove the . = 0x80008000; line, it works. Obviously, this is not
all I have to do, but this part should work for now, right?
TIA,
--
Rick
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why "relocation truncated to fit" with this linker script?
2007-10-31 0:55 Why "relocation truncated to fit" with this linker script? Rick Mann
@ 2007-10-31 2:26 ` Alan Modra
2007-10-31 19:02 ` Rick Mann
0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2007-10-31 2:26 UTC (permalink / raw)
To: Rick Mann; +Cc: binutils
You have multiple .text output sections. The linker can't handle
this.
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why "relocation truncated to fit" with this linker script?
2007-10-31 2:26 ` Alan Modra
@ 2007-10-31 19:02 ` Rick Mann
0 siblings, 0 replies; 3+ messages in thread
From: Rick Mann @ 2007-10-31 19:02 UTC (permalink / raw)
To: Alan Modra; +Cc: binutils
On Oct 30, 2007, at 7:23 PM, Alan Modra wrote:
> You have multiple .text output sections. The linker can't handle
> this.
Really? It was handling it just fine before I started trying to use
memory regions and have chunks of code in vastly distance places.
--
Rick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-10-31 19:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-31 0:55 Why "relocation truncated to fit" with this linker script? Rick Mann
2007-10-31 2:26 ` Alan Modra
2007-10-31 19:02 ` Rick Mann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).