llvm-capstone/lld
Rafael Espindola aad64e0a1c Tweak orphan section placement.
Given a linker script that ends in

.some_sec { ...} ;
__stack_start = .;
. = . + 0x2000;
__stack_end = .;

lld would put orphan sections like .comment before __stack_end,
corrupting the intended meaning.

The reason we don't normally move orphans past assignments to . is to
avoid breaking

rx_sec : { *(rx_sec) }
. = ALIGN(0x1000);
/* The RW PT_LOAD starts here*/

but in this case, there is nothing after and it seems safer to put the
orphan section last. This seems to match bfd's behavior and is
convenient for writing linker scripts that care about the layout of
SHF_ALLOC sections, but not of any non SHF_ALLOC sections.

llvm-svn: 313646
2017-09-19 17:29:58 +00:00
..
cmake/modules
COFF Revert r303378: Set IMAGE_DLL_CHARACTERISTICS_NO_BIND. 2017-09-15 22:49:13 +00:00
docs Update the monorepo URL in a lld's document. 2017-09-15 21:04:43 +00:00
ELF Tweak orphan section placement. 2017-09-19 17:29:58 +00:00
include/lld LLD: Introduce a GNU LD style driver for COFF 2017-09-11 17:02:59 +00:00
lib [MACH-O] Fix the ASM code generated for __stub_helpers section 2017-08-24 23:51:40 +00:00
MinGW Accept not only --foo but also -foo. 2017-09-14 18:33:21 +00:00
test Tweak orphan section placement. 2017-09-19 17:29:58 +00:00
tools/lld LLD: Introduce a GNU LD style driver for COFF 2017-09-11 17:02:59 +00:00
unittests
.arcconfig
.clang-format
.gitignore
CMakeLists.txt LLD: Introduce a GNU LD style driver for COFF 2017-09-11 17:02:59 +00:00
CODE_OWNERS.TXT
LICENSE.TXT
README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.