You copied the Doc URL to your clipboard.

Recommendations for using ld scripts with armlink

Follow these recommendations when producing ld scripts for use with armlink:

Recommendations for producing ld scripts for ARM Linux

The dynamic loader requires some output sections with a specific type to work properly. These are:

  • Hash Table

  • String Table

  • Dynamic Symbol Table

  • Dynamic Section

  • Version Sections

  • Thread Local Storage Sections.

General recommendations

The following are general recommendations:

  • Make sure each output section has a homogenous type. For example:

       .text : { *(.text) }
       .data : { *(.data) }
       .bss :  { *(.bss) }
    

    This is preferred to the following:

       .stuff
       {
           *(.text)
           *(.data)
           *(.bss)
       }
    
  • If you are running the ELF file on ARM Linux do not modify the location of the meta-data used by the dynamic linker.

  • Sections not matched by the SECTIONS command are marked as orphans. The linker places orphan sections in appropriate locations. The linker attempts to match the placement of orphans used by ld although this is not always possible. Use explicit placement if you do not like how armlink places orphans.

Was this page helpful? Yes No