Skip to content

Commit 2bb8c54

Browse files
schultetwin1arcnmx
authored andcommitted
[lld][ELF] Mark empty NOLOAD output sections SHT_NOBITS instead of SHT_PROGBITS
This fixes PR# 45336. Output sections described in a linker script as NOLOAD with no input sections would be marked as SHT_PROGBITS. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D76981
1 parent 5992729 commit 2bb8c54

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lld/ELF/ScriptParser.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ bool ScriptParser::readSectionDirective(OutputSection *cmd, StringRef tok1, Stri
737737
expect("(");
738738
if (consume("NOLOAD")) {
739739
cmd->noload = true;
740+
cmd->type = SHT_NOBITS;
740741
} else {
741742
skip(); // This is "COPY", "INFO" or "OVERLAY".
742743
cmd->nonAlloc = true;

0 commit comments

Comments
 (0)