This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
ld-linkerscript: ROM-output
- From: Josef Angermeier <Josef dot Angermeier at informatik dot stud dot uni-erlangen dot de>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 25 Oct 2005 09:33:57 +0200
- Subject: ld-linkerscript: ROM-output
Hello
Im using a ld-linker script to generate an ROM-based application. Here
is a part of it:
lma_init_text = lma_init_rm;
vma_init_text = vma_init_rm;
.init.text vma_init_text : AT
(lma_init_text) {
*(.init.text)
}
elma_init_text = lma_init_text + SIZEOF(.init.text);
vma_init_data = vma_init_text + SIZEOF(.init.text);
.init.data vma_init_data : AT (lma_init_data)
{
*(.init.data)
}
lma_init_data = lma_init + (ADDR(.init.data) - vma_init);
elma_init_data = lma_init_data + SIZEOF(.init.data);
In short, i put two sections behind each other in the ROM file and at
execution in memory. The reason i do this complicated way is, that
ADDR(.init.text) and vma_init_text can differ, because of a possible
alignment.
Is there any easier way to express this ?
And i wonder if this 'defining the load address' after the corresponding
section is actually a really supported feature ?
ciao
josef