A tiebreaker is used when a sorting algorithm requires a total ordering of sections. It is used to resolve the order when the sorting criteria results in more than one input section with equal properties.
--tiebreaker=option
where
is
one of:option
creation
The order that the linker creates sections in its internal section data structure.
When the linker creates an input section for each ELF section in the input objects, it increments a global counter. The value of this counter is stored in the section as the creation index.
The creation index of a section is unique apart from the special case of inline veneers.
cmdline
The order that the section appears on the linker command-line. The command-line order is defined as
File.Object.Section
where:Section
is the section index,sh_idx
, of theSection
in theObject
Object
is the order thatObject
appears in theFile
File
is the order theFile
appears on the command line.
The order the
Object
appears in theFile
is only significant if the file is an ar archive.This option is useful if you are doing a binary difference between the results of different links, link1 and link2. If link2 has only small changes from link1, then you might want the differences in one source file to be localized. In general, creation index works well for objects, but because of the multiple pass selection of members from libraries, a small difference such as calling a new function can result in a different order of objects and therefore a different tiebreak. The command-line index is more stable across builds.
Use this option with the --scatter
option.