meta data for this page
  •  

This is an old revision of the document!


Linker

  • –as-needed - do not load symbols from libraries specified in command line when they are not needed. This option couses many unresolved symbol errors when order of libraries specified in command line is not correct. http://savannah.gnu.org/forum/forum.php?forum_id=5655

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html

Place some symbols

    .bss :
    {
        _bss = .;
        *(EXCLUDE_FILE (*redoznes.co) .bss*)
/*        *(.bss*)*/
        *(COMMON)
        _ebss = .;
    } > SRAM
    
   ._user_heap_stack :
    {
      *redzones.co(.bss.redzone1)
      . = ALIGN(4);
      end = .;
      _heap = .; /* "end" for newlib's syscalls, "_heap" for sbrk heap boundary checks */
      . = . + _Min_Heap_Size;
      _eheap = .;
      *redoznes.co(.bss.redzone2)
      . = . + _Min_Stack_Size;
      . = ALIGN(4);
    } > SRAM

Optimize per function

int foo(int i) __attribute__((optimize("-O3")));