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

2 days ago

CHILD VidPic Sep

6 days ago

Only For Boys

8 days ago

CH1LD-VIDEO-PICT

11 days ago

My Video

16 days ago

Movie Video Coll

16 days ago

1043108610901086

18 days ago

Information soci

61 days ago

Untitled

123 days ago

DATABASES EMAILS

123 days ago

1041104010471040