ld: Orphan Sections

1 
1 3.10.4 Orphan Sections
1 ----------------------
1 
1 Orphan sections are sections present in the input files which are not
1 explicitly placed into the output file by the linker script.  The linker
1 will still copy these sections into the output file by either finding,
1 or creating a suitable output section in which to place the orphaned
1 input section.
1 
1    If the name of an orphaned input section exactly matches the name of
1 an existing output section, then the orphaned input section will be
1 placed at the end of that output section.
1 
1    If there is no output section with a matching name then new output
1 sections will be created.  Each new output section will have the same
1 name as the orphan section placed within it.  If there are multiple
1 orphan sections with the same name, these will all be combined into one
1 new output section.
1 
1    If new output sections are created to hold orphaned input sections,
1 then the linker must decide where to place these new output sections in
1 relation to existing output sections.  On most modern targets, the
1 linker attempts to place orphan sections after sections of the same
1 attribute, such as code vs data, loadable vs non-loadable, etc.  If no
1 sections with matching attributes are found, or your target lacks this
1 support, the orphan section is placed at the end of the file.
1 
11    The command line options '--orphan-handling' and '--unique' (⇒
 Command Line Options Options.) can be used to control which output
1 sections an orphan is placed in.
1