section alignment & load address alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux