ld-linkerscript: ROM-output

Josef Angermeier Josef.Angermeier@informatik.stud.uni-erlangen.de
Tue Oct 25 07:34:00 GMT 2005


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



More information about the Gcc-help mailing list