Do not hard code the leading underscore.

Mangling scheme varies on platform, and prepending an underscore is valid only
on 32-bit x86. Added a method to mangle name to PECOFFLinkingContext and use
it to avoid hard coding mangled names.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190585 91177308-0d34-0410-b5e6-96231b3b80d8
Remove hard-coded leading underscore from entry symbol.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@190586 91177308-0d34-0410-b5e6-96231b3b80d8
[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
[lld][LayoutPass] change comments to reflect the sort order

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