[PECOFF] Add helper functions for debugging

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@189570 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Fix bug that atom size was sometimes wrong.

Because of a bug, the last atom of each section contained a garbage at the
end of its data. In most cases the garbage is harmless but it could have cause
SEGV.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@189572 91177308-0d34-0410-b5e6-96231b3b80d8
[PECOFF] Fix bug that section grouping may lay out atoms in a wrong order.

We added layout edges to the head atoms in grouped sections. That was wrong,
because the head atom needs to be followed by the other atoms in the *same*
section, not by the other section contents. With this patch, layout edges are
added from tail atom, which is the last atom in a section, to head atom.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@189573 91177308-0d34-0410-b5e6-96231b3b80d8