You copied the Doc URL to your clipboard.

Default GNU ld scripts used by armlink

The linker has default ld scripts it can apply in GNU mode if you do not specify an ld script of your own.

If you use command-line options that require an ld script, you can specify a script to use with the --linker_script command-line option. If you do not specify a script, the default ld script used by armlink depends on whether you are building an executable or a shared object.

Default ld script when building an executable

SECTIONS
{
  PROVIDE(__executable_start = 0x0008000);
  . = 0x00008000 + SIZEOF_HEADERS;
  .interp         : { *(.interp) }
  .note.ABI-tag   : { *(.note.ABI-tag) }
  .hash           : { *(.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .version        : { *(.version) }
  .version_d      : { *(.version_d) }
  .version_r      : { *(.version_r) }
  .rel.dyn        : { *(.rel.dyn) }
  .rela.dyn       : { *(.rela.dyn) }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           : { KEEP (*(.init)) }
  .plt            : { *(.plt) }
  .text           : { *(.text .text.*) }
  .fini           : { KEEP (*(.fini)) }
  PROVIDE(__etext = .);
  PROVIDE(_etext = .);
  PROVIDE(etext = .);
  .rodata         : { *(.rodata .rodata.*) }
   __exidx_start = .;
  .ARM.exidx   : { *(.ARM.exidx*) }
   __exidx_end = .;
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1));
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  .tdata             : { *(.tdata .tdata.*) }
  .tbss              : { *(.tbss .tbss.*) }
  .preinit_array     :
  {
     PROVIDE_HIDDEN (__preinit_array_start = .); 
     KEEP (*(.preinit_array))
     PROVIDE_HIDDEN (__preinit_array_end = .); 
  }
  .init_array     :
  {
     PROVIDE_HIDDEN (__init_array_start = .); 
     KEEP (*(.init_array*))
     PROVIDE_HIDDEN (__init_array_end = .); 
  }
  .fini_array     :
  {
     PROVIDE_HIDDEN (__fini_array_start = .); 
     KEEP (*(.fini_array*))
     PROVIDE_HIDDEN (__fini_array_end = .); 
  }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got.plt) *(.got) }
  .data           :
  {
    __data_start = .;
    *(.data .data.*)
  }
  _edata = .;
  PROVIDE(edata = .);
  __bss_start = .;
  __bss_start__ = .;
  .bss            :
  {
   *(.bss .bss.*)
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  __bss_end__ = .;
  _bss_end__ = .;
  . = ALIGN(4);
  __end = .;
  _end = .;
  PROVIDE(end = .);
}

Default ld script when building a shared object

SECTIONS
{
  . = 0 + SIZEOF_HEADERS;
  .note.ABI-tag   : { *(.note.ABI-tag) }
  .hash           : { *(.hash) }
  .dynsym         : { *(.dynsym) }
  .dynstr         : { *(.dynstr) }
  .version        : { *(.version) }
  .version_d      : { *(.version_d) }
  .version_r      : { *(.version_r) }
  .rel.dyn        : { *(.rel.dyn) }
  .rela.dyn       : { *(.rela.dyn) }
  .rel.plt        : { *(.rel.plt) }
  .rela.plt       : { *(.rela.plt) }
  .init           : { KEEP (*(.init)) }
  .plt            : { *(.plt) }
  .text           : { *(.text .text.*) }
  .fini           : { KEEP (*(.fini)) }
  PROVIDE(__etext = .);
  PROVIDE(_etext = .);
  PROVIDE(etext = .);
  .rodata         : { *(.rodata .rodata.*) }
   __exidx_start = .;
  .ARM.exidx   : { *(.ARM.exidx*) }
   __exidx_end = .;
  .interp         : { *(.interp) }
  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1));
  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
  .tdata             : { *(.tdata .tdata.*) }
  .tbss              : { *(.tbss .tbss.*) }
  .preinit_array     :
  {
     PROVIDE_HIDDEN (__preinit_array_start = .); 
     KEEP (*(.preinit_array))
     PROVIDE_HIDDEN (__preinit_array_end = .); 
  }
  .init_array     :
  {
     PROVIDE_HIDDEN (__init_array_start = .); 
     KEEP (*(.init_array*))
     PROVIDE_HIDDEN (__init_array_end = .); 
  }
  .fini_array     :
  {
     PROVIDE_HIDDEN (__fini_array_start = .); 
     KEEP (*(.fini_array*))
     PROVIDE_HIDDEN (__fini_array_end = .); 
  }
  .dynamic        : { *(.dynamic) }
  .got            : { *(.got.plt) *(.got) }
  .data           :
  {
    __data_start = .;
    *(.data .data.*)
  }
  _edata = .;
  PROVIDE(edata = .);
  __bss_start = .;
  __bss_start__ = .;
  .bss            :
  {
   *(.bss .bss.*)
   . = ALIGN(. != 0 ? 32 / 8 : 1);
  }
  __bss_end__ = .;
  _bss_end__ = .;
  . = ALIGN(4);
  __end = .;
  _end = .;
  PROVIDE(end = .);
}

Default ld script when building a --ldpartial partially linked object

SECTIONS
{
  .interp       0  : { *(.interp) }
  .note.ABI-tag 0  : { *(.note.ABI-tag) }
  .hash         0  : { *(.hash) }
  .dynsym       0  : { *(.dynsym) }
  .dynstr       0  : { *(.dynstr) }
  .version      0  : { *(.version) }
  .version_d    0  : { *(.version_d) }
  .version_r    0  : { *(.version_r) }
  .rel.dyn      0  : { *(.rel.dyn) }
  .rel.plt      0  : { *(.rel.plt) }
  .init         0  : { KEEP (*(.init)) }
  .plt          0  : { *(.plt) }
  .text         0  : { *(.text) }
  .fini         0  : { KEEP (*(.fini)) }
  .rodata       0  : { *(.rodata) }
  .ARM.exidx    0  : { *(.ARM.exidx*) }
  .tdata        0  : { *(.tdata) }
  .tbss         0  : { *(.tbss) }
  .preinit_array   0  :
  {
     KEEP (*(.preinit_array))
  }
  .dynamic      0  : { *(.dynamic) }
  .got          0  : { *(.got.plt) *(.got) }
  .data         0  :
  {
    *(.data)
  }
  .bss          0  :
  {
   *(.bss)
  }
}
Was this page helpful? Yes No