Skip to content

Commit 832055a

Browse files
authored
Update Writer.cpp
1 parent 9c9296f commit 832055a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lld/COFF/Writer.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,8 +2014,12 @@ void Writer::setSectionPermissions() {
20142014
StringRef name = p.first;
20152015
uint32_t perm = p.second;
20162016
for (OutputSection *sec : ctx.outputSections)
2017-
if (sec->name == name)
2018-
sec->setPermissions(perm);
2017+
if (sec->name == name) {
2018+
if (ctx.config.driver && name == "INIT")
2019+
sec->appendPermissions(perm);
2020+
else
2021+
sec->setPermissions(perm);
2022+
}
20192023
}
20202024
}
20212025

0 commit comments

Comments
 (0)