DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
COFF link editor

Allocation algorithm

An output section is formed as a result of a SECTIONS directive, by combining input sections of the same name, or by combining .text and .init into .text. An output section can consist of zero or more input sections. After the composition of an output section is determined, it must then be allocated into configured virtual memory. The COFF link editor uses an algorithm that attempts to minimize fragmentation of memory, and hence increase the possibility that a link edit run will be able to allocate all output sections within the specified virtual memory configuration. The algorithm proceeds as follows:

  1. Any output sections for which explicit binding addresses are specified are allocated

  2. Any output sections to be included in a specific named memory range are allocated. Each output section is placed into the first available space within named memory with any alignment taken into consideration.

  3. Output sections not handled by one of the above steps are allocated. Each output section is placed into the first available space within memory with any alignment taken into consideration.

If all memory is contiguous and configured (the default case), and no SECTIONS directives are given, then output sections are allocated in the order they appear to ld.


Next topic: Incremental link editing
Previous topic: The -u option

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003