[ELF] - Linkerscript: make section with no content to be SHT_PROGBITS by default.
authorGeorge Rimar <grimar@accesssoftek.com>
Fri, 14 Apr 2017 09:37:00 +0000 (09:37 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Fri, 14 Apr 2017 09:37:00 +0000 (09:37 +0000)
commit1022112d770f49b3697d2b7267f5f9915409de41
tree4e4284f0d94a39a3d669f24e8f46fb2278fb5e56
parent36a0b98e242e92e257acca87accfc1679798a41e
[ELF] - Linkerscript: make section with no content to be SHT_PROGBITS by default.

Imagine next script:

SECTIONS { BYTE(0x11); }

Section content written to disk will be 0x11. Previous LLD behavior was to make this
section SHT_NOBITS. What is not correct because section has content.
ld.bfd makes such sections SHT_PROGBITS, this patch do the same.

This fixes PR32537

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

llvm-svn: 300317
lld/ELF/LinkerScript.cpp
lld/test/ELF/linkerscript/orphan-first-cmd.s
lld/test/ELF/linkerscript/symbol-only.s