[ELF] - Drop special flags for empty output sections.
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 13 Mar 2018 08:32:56 +0000 (08:32 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 13 Mar 2018 08:32:56 +0000 (08:32 +0000)
commitafbf90aef9e7878a2b139c3f7a5ef22b5d34caf7
tree526c3fa764f35294f28c1629bc404c43991ade1a
parent2371e0a1c853ea8b9c562d34c9aba6b8f4ccc379
[ELF] - Drop special flags for empty output sections.

This fixes PR36598.

LLD currently crashes when we have empty output section
with SHF_LINK_ORDER flag. This might happen if we place an
empty synthetic section in the linker script, but keep output
section alive with the use of additional symbol, for example.

The patch fixes the issue by dropping all special flags
for empty sections.

Differential revision: https://reviews.llvm.org/D44376

llvm-svn: 327374
lld/ELF/LinkerScript.cpp
lld/test/ELF/linkerscript/empty-link-order.test [new file with mode: 0644]