If the execution region contains more code than the range
of a branch instruction then the linker switches to large region
mode. In this mode the linker sorts according to the approximated average
call depth of each section in ascending order. The linker might
also place distribute veneers amongst the code sections to minimize
the number of veneers.
Note
Large region mode can result in large changes to the layout
of an image even when small changes are made to the input.
To disable large region mode and revert to lexical order,
use --no_largeregions. Section placement is then
predictable and image comparisons are more predictable. However
some branches might not reach the target causing the link step to
fail. If this happens you must place code/data sections explicitly
using an appropriate scatter file or write your own veneer.
Large region support enables:
average call depth sorting, --sort=AvgCallDepth
API sorting, --api
veneer injection, --veneerinject.
The following command lines are equivalent:
armlink --largeregions --no_api --no_veneerinject --sort=Lexical
armlink --no_largeregions