71 lines · plain
1// An example of thunk generation that takes the maximum number of permitted2// passes to converge. We start with a set of branches of which all but one are3// in range. Any thunk added to extend the range of a branch is inserted in4// between the branches and the targets which knocks some more branches out5// of range. At the end of 9 passes of createThunks() every branch has a6// range extension thunk, allowing the final pass to check that no more thunks7// are required.8//9// As the size of the .text section changes 9 times, the symbol sym which10// depends on the size of .text will be updated 9 times. This test checks that11// any iteration limit to updating symbols does not limit thunk convergence.12// up to its pass limit without13 14 .thumb15 .section .text.00, "ax", %progbits16 .globl _start17 .thumb_func18_start: b.w f219 b.w f220 b.w f321 b.w f322 b.w f423 b.w f424 b.w f525 b.w f526 b.w f627 b.w f628 b.w f729 b.w f730 b.w f831 b.w f832 b.w f933 b.w f934 b.w f1035 b.w f1036 37 .section .text.01, "ax", %progbits38 .space 14 * 1024 * 102439// Thunks are inserted here, initially only 1 branch is out of range and needs40// a thunk. However the added thunk is 4-bytes in size which makes another41// branch out of range, which adds another thunk ...42 .section .text.02, "ax", %progbits43 .space (2 * 1024 * 1024) - 6844 .thumb_func45f2: bx lr46 nop47 .thumb_func48f3: bx lr49 nop50 .thumb_func51f4: bx lr52 nop53 .thumb_func54f5: bx lr55 nop56 .thumb_func57f6: bx lr58 nop59 .thumb_func60f7: bx lr61 nop62 .thumb_func63f8: bx lr64 nop65 .thumb_func66f9: bx lr67 nop68 .thumb_func69f10: bx lr70 nop71