This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

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


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