[LLD][LinkerScript] Allow non-alloc sections to be assigned to segments.
This patch makes changes to allow sections without the SHF_ALLOC bit to be assigned to segments in a linker script. The assignment of output sections to segments is performed in LinkerScript::createPhdrs. Previously, this function would bail as soon as it encountered an output section which did not have the SHF_ALLOC bit set, thus preventing any output section without SHF_ALLOC from being assigned to a segment. This restriction has now been removed from LinkerScript::createPhdrs and instead a check for SHF_ALLOC has been added to LinkerScript::adjustSectionsAfterSorting to not propagate program headers to sections without SHF_ALLOC which matches the behaviour of bfd linker scripts. Differential Revision: https://reviews.llvm.org/D34204 llvm-svn: 307013
Loading
Please register or sign in to comment