The linker validates that the inputs that it is merging follow the same
ABI restrictions (i.e. floating point ABI and RVE). However, the check
is not required or applicable when the input does not have code content
such as a data file. This relaxes the check to only perform the checks
when the input is non-empty and has loaded code sections. This matches
the behaviour of the BFD linker and enables adding data files which may
have mismatched ABI tags.
This also changes the behaviour of the RVC tagging to match BFD: the RVC
flag is only preserved if the input contributes code to the final
binary.
Rewrite the flag checking to use XOR which feels easier to read than the
equality check.
This test seems too broad to only match loaded machine code sections. You need to check whether both flags are set.