The .ARM.exidx sections have a reverse dependency on the InputSections that they have a link order dependency to. In effect they should be live only if the InputSection they refer to via the sh_link field is live.
I've used a single pointer to InputSection rather than a vector as there is an InputSection can only have at most one InputSection (.ARM.exidx) with a SHF_LINK_ORDER dependency on it.
This has been split off from https://reviews.llvm.org/D25127 which contains the basic .ARM.exidx recognition and sorting. It implements Rui's suggestion of adding the reverse dependency to InputSections.
The lld changes don't depend on D25127 but the test case may do as it checks the contents of the .ARM.exidx section.
clang-format-diff please.