Understanding the Location Counter of GNU Linker Scripts

后端 未结 2 889
花落未央
花落未央 2020-12-08 05:36

I\'m working on a university project where I\'m writing software for an Atmel SAM7S256 microcontroller from the ground up. This is more in depth than other MCUs I\'ve worked

2条回答
  •  一向
    一向 (楼主)
    2020-12-08 06:33

    The placement of the section is determined by the memory region after the closing brace (>RAM AT>ROM). So the execution address is in RAM at 0x00200000 and following, but the load address is in ROM (flash) at 0x00100000. The startup code must copy the .fastcode output section from its load to its execution address, that's what the symbols are for.

    Note that these need not be at address 0, because the AT91SAM7S remaps either RAM or ROM to address 0. Usually it starts up with ROM mapped, and the startup code switches that to RAM.

提交回复
热议问题