You copied the Doc URL to your clipboard.

Examples of using sorting algorithms for .ANY sections

These examples show the operation of the sorting algorithms for RO-CODE sections in sections_a.o and sections_b.o.

The input section properties and ordering are shown in the following tables:

Table 12. Input section properties for sections_a.o
NameSize
seca_10x4
seca_20x4
seca_30x10
seca_40x14

Table 13. Input section properties for sections_b.o
NameSize
secb_10x4
secb_20x4
secb_30x10
secb_40x14

Descending size example

The following linker command-line options are used for this example:

--any_sort_order=descending_size sections_a.o sections_b.o --scatter scatter.txt

The order that the sections are processed by the .ANY assignment algorithm is:

Table 14. Sort order for descending_size algorithm
NameSize
seca_40x14
secb_40x14
seca_30x10
secb_30x10
seca_10x4
seca_20x4
secb_10x4
secb_20x4

Sections of the same size use the tiebreak specified by --tiebreaker.

Command-line example

The following linker command-line options are used for this example:

--any_sort_order=cmdline sections_a.o sections_b.o --scatter scatter.txt

The order that the sections are processed by the .ANY assignment algorithm is:

Table 15. Sort order for cmdline algorithm
NameSize
seca_10x4
secb_10x4
seca_20x4
secb_20x4
seca_30x10
secb_30x10
seca_40x14
secb_40x14

Sections with the same command-line index use the tiebreak specified by --tiebreaker.

Was this page helpful? Yes No