SPRUI04F july 2015 – april 2023
The unordered() operator can be used in a linker command file. The effect of this operator is to relax the placement constraints placed on an output section specification in which the content of the output section is explicitly stated.
Consider an example output section specification:
SECTIONS
{
.text:
{
file.obj(.text:func_a)
file.obj(.text:func_b)
file.obj(.text:func_c)
file.obj(.text:func_d)
file.obj(.text:func_e)
file.obj(.text:func_f)
file.obj(.text:func_g)
file.obj(.text:func_h)
*(.text)
} > PMEM
...
}
In this SECTIONS directive, the specification of .text explicitly dictates the order in which functions are laid out in the output section. Thus by default, the linker will layout func_a through func_h in exactly the order that they are specified, regardless of any other placement priority criteria (such as a preferred function order list that is enumerated by --preferred_order options).
The unordered() operator can be used to relax this constraint on the placement of the functions in the '.text' output section so that placement can be guided by other placement priority criteria.
The unordered() operator can be applied to an output section as in Example4-2.