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]

Re: V850, linker problem


Hi,

i think the problem described is the following:

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

__ep should be in RAM, but as "." is in ROM at the moment
the error message is:
address 0x75ec of hw2.elf section .tdata is not within region RAM

Is this assumption correct?

I define some memory regions in the beginning of the linker
script, shouldn't "ld" have one "." per memory region defined?

How can i tell "ld" that "." refers to the "." of RAM?


Thanks fpr any hints,
Torsten.



> Hi,
>
> i asked for this previously on the newlib mailing list, but
> a it is related to linking i think it is placed here much better.
>
> I configured and installed a GNU cross toolchain for V850E.
>
> I want to develop for an embedded controller with specific
> memory layout.
>
> I first tried linking like this:
> $(F_ELF) $(F_MAP) : $(OBJ)
> 	$(CC) -o $(F_ELF) \
> 	-Wl,-Map=$(F_MAP) \
> 	-Wl,--section-start=.vectors=0x000000 \
> 	-Wl,--section-start=.text=0x000640 \
> 	-Wl,--section-start=.data=0x03ffe000 \
> 	-Wl,--section-start=.stack=0x03fffc00 \
> 	$(OBJ)
>
> But when creating sn SREC file i get data that is placed in RAM.
>
> I googled for this problem and got the hint ">ram AT>rom".
>
> So i created a linker script based on the original v850.x.
> I attached it to this mail.
>
> In that script there is a part like this:
>
>   .tdata ALIGN (4) :
>   {
> 	PROVIDE (__ep = .);
> 	*(.tbyte)
> 	*(.tcommon_byte)
> 	*(.tdata)
> 	*(.tbss)
> 	*(.tcommon)
>   } >ram AT>rom
>
> In here there is real RAM (.tbss) and ROM/RAM (.tdata) mixed.
>
> At linking 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
>
> So i've splitted those sections into two parts:
>
>   .tdata_ram ALIGN (4) :
>   {
> 	PROVIDE (__ep = .);
> 	*(.tbyte)
> 	*(.tcommon_byte)
> 	*(.tbss)
> 	*(.tcommon)
>   } >ram
>
>   .tdata_rom ALIGN (4) :
>   {
> 	*(.tdata)
>   } >ram AT>rom
>
> But i still get the same error.
>
>
> Can anybody give me a hint on how to link a program for a V850?
>
>
> Best regards,
> Torsten.


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