6.3 Linking Sections

The optimizing linkage editor links the same sections within input relocatable files, and allocates addresses specified by the start option.

(1)

The same section names in different files are allocated continuously in the order of file input.

(2)

Sections with the same name but different boundary alignments are linked after alignment. Section alignment uses the larger of the section alignments.

(3)

When sections with the same name include both absolute-address and relative-address formats, relative-address sections are linked following absolute-address sections.

(4)

Rules for the order of linking sections with the same name are based on their priorities as follows.

-

Order specified by the input option or input files on the command line

-

Order specified for the user library by the library option and order of input of modules within the library

-

Order specified for the system library by the library option and order of input of modules within the library

-

Order specified for libraries by environment variables (HLNK_LIBRARY1 to HLNK_LIBRARY3) and order of input of modules within the library