With this patch we use the first scan over the relocations to remember the information we found about them: will them be relaxed, will a plt be used, etc.
With that the actual relocation application becomes much simpler. That is particularly true for the interfaces in Target.h.
This passes all tests, but I am still debugging a difference in the produced clang binary.
I'd define R_* names directly inside lld::ELF namespace because they don't conflict with other identifiers because of its R_ prefix.