Sections L with the SHF_LINK_ORDER flag must be ordered in the same relative order as the Sections they have a link to. When using a linker script an arbitrary expression may be used for the virtual address of the OutputSection. In some cases the virtual address does not monotonically increase as the OutputSection index increases, so if we base the ordering of the SHF_LINK_ORDER sections on the index then we can get the order wrong. We fix this by moving SHF_LINK_ORDER resolution till after we have created OutputSection virtual addresses.
This is a follow up patch from D78422 which moved the .ARM.exidx to a similar place.
Confirmed that gc-sections-linkorder-err.s (initially added in D67761) needs early-return here.