Second chunk split out of D41955.
Must be committed simultaneously with LLVM change, D42080.
Changes:
- LLD updated to handle new table reloc data (see D42080)
- Now, we build the output table by iterating over all the non-Discarded Functions and Segments, rather than iterating over all the Symbols. This means that when we implement GC, the function table will actually be pruned properly.
- A small block of code in InputChunks::calcRelocations has been factored out into ObjFile::calcNewValue to match ObjFile::calcNewIndex.
- Relocatable output has been updated in the same way as for D42080, so the change to that test is correct
perhaps call this relocateAddress, relocateVirtualAddress or relocateMemoryLocation or something similar to match the functions below?