summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorAndrew Ng <anng.sw@gmail.com>2019-04-23 12:38:52 +0000
committerAndrew Ng <anng.sw@gmail.com>2019-04-23 12:38:52 +0000
commitccba42c7eb3cdfe7824cd4b473a9688e5738fa3a (patch)
treebbcf5c9f1cda372d1845d8004e336997c2a0f2a3 /lld/ELF/LinkerScript.cpp
parent2769d58628f948b55891a5b3c1073080415f6c17 (diff)
downloadbcm5719-llvm-ccba42c7eb3cdfe7824cd4b473a9688e5738fa3a.tar.gz
bcm5719-llvm-ccba42c7eb3cdfe7824cd4b473a9688e5738fa3a.zip
[ELF] Change default output section type to SHT_PROGBITS
This fixes an issue where a symbol only section at the start of a PT_LOAD segment, causes incorrect alignment of the file offset for the start of the segment which results in the output of an invalid ELF. SHT_PROGBITS was the default output section type in the past. Differential Revision: https://reviews.llvm.org/D60131 llvm-svn: 358981
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 d6e7a28cdca..006b962c624 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -86,7 +86,7 @@ OutputSection *LinkerScript::createOutputSection(StringRef Name,
// There was a forward reference.
Sec = SecRef;
} else {
- Sec = make<OutputSection>(Name, SHT_NOBITS, 0);
+ Sec = make<OutputSection>(Name, SHT_PROGBITS, 0);
if (!SecRef)
SecRef = Sec;
}
OpenPOWER on IntegriCloud