section alignment & load address alignment
Josef Angermeier
sijoange@cip.informatik.uni-erlangen.de
Fri Sep 2 11:38:00 GMT 2005
Hello
in my ld linker script i got something like that:
load_start_data = rom_start + (. - old_rom_start);
.data : AT (load_start_data) { /* Must be read-only! */
*(.data)
}
Unfortunately this causes problems if .data section has an alignment.
Then not "." (location counter) is used for its address, but the aligned
address. But if alignment is used the load_start_data (LMA address) is
abit wrong, because it should correspondingly also get aligned. This
isn't automatically done.
I tried to fix this by using ADDR(.data) instead of "."
load_start_data = rom_start + (ADDR(.data) - old_rom_start);
this works, but apparently just with new "ld"-versions. So is there any
elegant way to fix this ?
Elsewise i must manually align all LMA section addresses.
thanks in advance
josef
More information about the Gcc-help
mailing list