summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2017-04-14 09:37:00 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2017-04-14 09:37:00 +0000
commit1022112d770f49b3697d2b7267f5f9915409de41 (patch)
tree4e4284f0d94a39a3d669f24e8f46fb2278fb5e56 /lld/ELF/LinkerScript.cpp
parent36a0b98e242e92e257acca87accfc1679798a41e (diff)
downloadbcm5719-llvm-1022112d770f49b3697d2b7267f5f9915409de41.tar.gz
bcm5719-llvm-1022112d770f49b3697d2b7267f5f9915409de41.zip
[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
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index 5a9e4652b22..ab2ca22e9e1 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -632,7 +632,7 @@ void LinkerScript::adjustSectionsBeforeSorting() {
// '.' is assigned to, but creating these section should not have any bad
// consequeces and gives us a section to put the symbol in.
uint64_t Flags = SHF_ALLOC;
- uint32_t Type = SHT_NOBITS;
+ uint32_t Type = SHT_PROGBITS;
for (BaseCommand *Base : Opt.Commands) {
auto *Cmd = dyn_cast<OutputSectionCommand>(Base);
if (!Cmd)
OpenPOWER on IntegriCloud