This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: linker script for V850?
Hi,
> Get the CVS version of newlib, look in src/libgloss/m32c/
thanks for that hint, i found "m32c.tmpl" and looked into it.
It describes very well how to provide symbols to copy .data
from ROM to RAM. For this issue it will help well and is
a good example.
But the main part that i don't know how to proceed with is
this one:
V850 has something called "tiny data area" which can be accessed
fast.
For V850, there is a construct like this in v850.x:
 .tdata ALIGN (4) :
 {
ÂÂÂÂÂÂÂÂPROVIDE (__ep = .);
ÂÂÂÂÂÂÂÂ*(.tbyte)
ÂÂÂÂÂÂÂÂ*(.tcommon_byte)
ÂÂÂÂÂÂÂÂ*(.tdata)
ÂÂÂÂÂÂÂÂ*(.tbss)
ÂÂÂÂÂÂÂÂ*(.tcommon)
 }
In there there is .tdata and .tbss.
So my first try to change the last line to contain ">ram AT>rom"
did not work.
So i tried to split it into two sections ".tdata_ram" and
".tdata_rom":
.tdata_ram ALIGN (4) :
{
PROVIDE (__ep = .);
*(.tbyte)
*(.tcommon_byte)
*(.tbss)
*(.tcommon)
} >ram
.tdata_rom ALIGN (4) :
{
*(.tdata)
} >ram AT>rom
But this also fails. I expected this to work, as i really separate
RAM and ROM. The error at linking is this:
v850e-unknown-elf-gcc -o hw2.elf \
ÂÂÂÂÂÂÂÂ-Wl,-Map=hw2.map \
ÂÂÂÂÂÂÂÂ-Wl,-Tv850.x \
ÂÂÂÂÂÂÂÂmain.o vectors.o
c:\v850e\bin\..\lib\gcc\v850e-unknown-elf\3.4.6\..\..\..\..
\v850e-unknown-elf\bin\ld.exe: address 0x75ec of hw2.elf section .tdata is
not within region ram
c:\v850e\bin\..\lib\gcc\v850e-unknown-elf\3.4.6\..\..\..\..
\v850e-unknown-elf\bin\ld.exe: address 0x75f0 of hw2.elf section .sdata is
not within region ram
I don't know what is in these addresses mentioned above.
Best regards,
Torsten.