From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5750 invoked by alias); 1 May 2006 18:52:54 -0000 Received: (qmail 5737 invoked by uid 22791); 1 May 2006 18:52:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.s.netic.de (HELO mail.s.netic.de) (212.9.160.11) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 01 May 2006 18:52:48 +0000 Received: from host-213-178-187-25.dsl.netic.de ([213.178.187.25] helo=schleim.qwe.de) by mail.s.netic.de with esmtp (Exim 4.51) id 1FadVl-000HBL-Vf for binutils@sourceware.org; Mon, 01 May 2006 20:52:46 +0200 Received: from localhost (localhost [IPv6:::1]) by schleim.qwe.de (Postfix) with ESMTP id 66AD53B117 for ; Mon, 1 May 2006 20:54:05 +0200 (CEST) From: Torsten Mohr To: binutils@sourceware.org Subject: Re: V850, linker problem Date: Mon, 01 May 2006 18:52:00 -0000 User-Agent: KMail/1.8 References: <200604300855.32560.tmohr@s.netic.de> In-Reply-To: <200604300855.32560.tmohr@s.netic.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605012054.04934.tmohr@s.netic.de> X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00010.txt.bz2 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.