I've separated this out from D32233 as it takes a different approach. Overall I think it is an improvement.
The reordering code for SHF_LINK_ORDER works on OutputSection::Sections if any of the InputSections are covered by an InputSectionDescription from a script then the Script->assignAddresses will take precedence and will likely produce an incorrect order.
To make Script->assignAddresses() pick up the order from the OutputSection we make clear all the InputSectionDescriptions::Sections() to make the InputSections orphans.
A theoretical drawback of this approach is that it will ruin any symbols defined by the linker script for the OutputSection. However I think this won't be a problem in practice. The default linker script in ld.bfd is
PROVIDE_HIDDEN (__exidx_start = .); .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) } PROVIDE_HIDDEN (__exidx_end = .);
Which won't be troubled by making the InputSections Orphans.