This is a refactor to pave the way for supporting paired-ADDEND for ARM64. The only paired reloc type for X86_64 is SUBTRACTOR. In a later diff, I will add SUBTRACTOR for both X86_64 and ARM64.
- s/getImplicitAddend/getAddend/ because it handles all forms of addend: implicit, explicit, paired.
- add predicate bool isPairedReloc()
- check range of relInfo.r_symbolnum is internal, unrelated to user-input, so use assert(), not error()
- minor cleanups & rearrangements in InputFile::parseRelocations()
I wonder if it makes sense to use a std::pair<const relocation_info, const relocation_info> &. It should be tested, but I could see the compiler being smart enough to unpack the pair if possible, which just makes it much more clear that that the two parameters are the paired relocation. It took me a moment to realize that.
What happens in the case of an unpaired relocation?