- ----- GNU LD linker script -----
- MEMORY {
- FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k
- SRAM(rwx) : ORIGIN = 0x20000000, LENGTH = 264k
- }
- SECTIONS {
- .text {
- *(.text*)
- _stack_size = 1k;
- _stack_end = ORIGIN(SRAM) + LENGTH(SRAM); // top of RAM
- _stack_start = _stack_end - _stack_size;
- } > FLASH
- }
- ----- objdump -----
- ...
- 20042000 T _stack_end
- 20041c00 T _stack_start
- 10000500 T _stack_size
- ...
- ----- Question -----
- _stack_end looks good (0x20000000 + 0x42000) [264 × 1024 = 0x42000]
- _stack_start looks good (0x20042000 - 0x400) [1 × 1024 = 0x400]
- _stack_size, based on the math above, should be 0x400. The math for the other two values (_stack-end - _stack_size) is correct, but the value for _stack_size makes no sense to me. Am I misunderstanding what objdump is trying to tell me?