Am 05.02.2011 05:55, schrieb ali hagigat:
Lets consider the lines of that linker script again! First the location counter is set to 0xfffffff0 and the output .reset section starts from VMA=0xfffffff0. I think we both agree on that so far. But after .reset section, .=15 forces the location counter to be 15!!
Inside a section definition, the location pointer is relative to the start of the section. The section's location isn't always known beforehand (but you're right that it is in our case).
It means the location counter suddenly jumps from the top of memory to some where in the bottom! and then linker asks for storing 0x00 in the address of 15! or at the beginning of memory.
That would lead to a linker error. If you try ". = 0" at the place, the linker will fail: cannot move location counter backwards (from fffffffd to fffffff0)
.=15 does not set the size of .reset as you wrote. My suggestion was .=.+1 instead of .=15, or set VMA to one byte after the final .reset and then ask for writing 0x00 at the address of 0xffffffff.
This relies on knowledge that *(.reset) yields 15 bytes of data, and might break on runtime if it's less, or on build time if it's more. With ". = 15" you get deterministic behaviour on build time.
Patrick