1 // An example of thunk generation that takes the maximum number of permitted
2 // passes to converge. We start with
a set of branches of which all but one are
3 // in range. Any thunk added to extend the range of
a branch is inserted in
4 // between the branches
and the targets which knocks some more branches out
5 // of range. At the end of
9 passes of createThunks
() every branch has
a
6 // range extension thunk
, allowing the final pass to check that no more thunks
9 // As the size of the
.text section changes 9 times, the symbol sym which
10 // depends on the size of
.text will be updated 9 times. This test checks that
11 // any iteration limit to updating symbols does
not limit thunk convergence.
12 // up to its pass limit without
15 .section .text.00, "ax", %progbits
37 .section .text.01, "ax", %progbits
38 .space 14 * 1024 * 1024
39 // Thunks are inserted here
, initially only
1 branch is out of range
and needs
40 // a thunk. However the added thunk is
4-bytes in size which makes another
41 // branch out of range
, which adds another thunk
...
42 .section .text.02, "ax", %progbits
43 .space (2 * 1024 * 1024) - 68