[arm-gnu] LD - how to check memory size

Vaclav Peroutka vaclavpe at seznam.cz
Thu Apr 12 11:55:02 UTC 2012


Hello,

I have simple linker script like below. If I have two sections, they are collected correctly but size is not counted? Does anybody know, why ? It was disappointing when we found this feature. BTW. Is it feature, or bug in the script or in the linker ? How to correctly rewrite the script to have more sections and size checking ? If I have everything in one section, checking of course works.

Thank you for answer

MEMORY 
{
   MEM1 : ORIGIN = 0, LENGTH = 2K
}

SECTIONS
{
   .sec1 : 
   {
      . = ALIGN(Align_Length);
      __sec1_stack__ = . ;
      *(.sec1) 
      __end_sec1__ = . ;
      . = ALIGN(Align_Length);
   } >MEM1
   .sec2 : 
   {
      . = ALIGN(Align_Length);
      __sec2_stack__ = . ;
      *(.sec2) 
      __end_sec2__ = . ;
      . = ALIGN(Align_Length);
   } >MEM1
}




More information about the arm-gnu mailing list