From: Torsten Mohr <tmohr@s.netic.de>
To: binutils@sourceware.org
Subject: Re: V850, linker problem
Date: Mon, 01 May 2006 18:52:00 -0000 [thread overview]
Message-ID: <200605012054.04934.tmohr@s.netic.de> (raw)
In-Reply-To: <200604300855.32560.tmohr@s.netic.de>
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.
next parent reply other threads:[~2006-05-01 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200604300855.32560.tmohr@s.netic.de>
2006-05-01 18:52 ` Torsten Mohr [this message]
2006-05-02 10:44 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605012054.04934.tmohr@s.netic.de \
--to=tmohr@s.netic.de \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).