linker script for V850?

Torsten Mohr tmohr@s.netic.de
Fri Apr 28 21:23:00 GMT 2006


Hi,

i've set up a small test project for V850, which compiles
fine, but in the resulting S-REC file there are some
bytes allocated that are in RAM, actually the .data section.

Googling for that problem i've read a hint to write an own
linker script.  I've set up one based on the toolchains v850.x .

I've added a MEMORY-description and added ">ram AT>rom" to
section .data to fix this problem.  I've also added ">ram"
and ">rom" where appropriate.


But there are two constructs like this:

  .tdata ALIGN (4) :
  {
	PROVIDE (__ep = .);
	*(.tbyte)
	*(.tcommon_byte)
	*(.tdata)   /* Problem */
	*(.tbss)
	*(.tcommon)
  } >ram AT>rom


All these sections are in RAM, but i want to place .tdata into
ROM.  How can i do this?  I've added the complete linker script.

At the moment i get:
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
gmake: *** [hw2.elf] Error 1

Another questions, what are the names for the symbols to use in crt0.s
to copy .data from ROM to RAM?  Do i need to add these?


It would be great if somebody could give me some hints here.


Best regards,
Torsten.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v850.x
Type: text/x-objcsrc
Size: 5854 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20060428/138ef6b9/attachment.bin>


More information about the Newlib mailing list