[lld][LayoutPass] Order the atoms that are in the same chain

We need to order atoms that exist in the same chain. This is to make sure that
the command line order is preserved when we emit the atoms to the output file.

Credits: BigCheese for finding the bug.

Adds a test which otherwise would fail.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190608 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][ELF] Fix the readonly section order.

This associates rodata and sections which just have the SHF_ALLOC flag
to be set to typeConstant.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190609 91177308-0d34-0410-b5e6-96231b3b80d8
[lld][ELF] Fix vaddr of the first section

The first section in the output was not aligned to the alignment of the section.

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