From ccba42c7eb3cdfe7824cd4b473a9688e5738fa3a Mon Sep 17 00:00:00 2001 From: Andrew Ng Date: Tue, 23 Apr 2019 12:38:52 +0000 Subject: [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 --- lld/ELF/LinkerScript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lld/ELF/LinkerScript.cpp') 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(Name, SHT_NOBITS, 0); + Sec = make(Name, SHT_PROGBITS, 0); if (!SecRef) SecRef = Sec; } -- cgit v1.2.3