linker math - Posted on July Sat 16th 9:25 AM (Never Expires) - Format: text
  1. ----- GNU LD linker script -----
  2.  
  3.  
  4. MEMORY {
  5.     FLASH(rx) : ORIGIN = 0x10000000, LENGTH = 2048k
  6.     SRAM(rwx) : ORIGIN = 0x20000000, LENGTH = 264k
  7. }
  8.  
  9. SECTIONS {
  10.     .text {
  11.         *(.text*)
  12.  
  13.         _stack_size = 1k;
  14.         _stack_end = ORIGIN(SRAM) + LENGTH(SRAM); // top of RAM
  15.         _stack_start = _stack_end - _stack_size;
  16.     } > FLASH
  17. }
  18.  
  19. ----- objdump -----
  20. ...
  21. 20042000 T _stack_end
  22. 20041c00 T _stack_start
  23. 10000500 T _stack_size
  24. ...
  25.  
  26. ----- Question -----
  27. _stack_end looks good (0x20000000 + 0x42000) [264 1024 = 0x42000]
  28. _stack_start looks good (0x20042000 - 0x400) [1 1024 = 0x400]
  29. _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?

New Paste

Paste Options

Recent Pastes

6 days ago

Updated

19 days ago

NEW K1Ds VIDEOS

26 days ago

Amaranthine Voya

34 days ago

Untitled

80 days ago

linker math

93 days ago

avg

95 days ago

UPDATED KIDDO VI

101 days ago

Untitled

133 days ago

PERSONAL FILES A

152 days ago

file