Another case where we currently have almost duplicated code is the creation of dynamic relocations. First to decide if we need one, then to decide what to write.
This patch fixes it by passing more information from the relocation scan to the section writing code. This is the same idea used for r258723.
I actually think it should be possible to simplify this further by reordering things a bit in the writer. For example, we should be able to represent almost every position in the file with an OutputSeciton and offset. When writing it out we then just need to add the offset to the OutputSection VA.
Not all comments have a dot at the end.