Skip to content

Commit 404ac5d

Browse files
committed
Reduce indentation depth in checkExecuteOnlyReport
1 parent ddaf54d commit 404ac5d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

lld/ELF/Writer.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,13 +2200,17 @@ template <class ELFT> void Writer<ELFT>::checkExecuteOnlyReport() {
22002200
? "SHF_AARCH64_PURECODE"
22012201
: "SHF_ARM_PURECODE";
22022202
SmallVector<InputSection *, 0> storage;
2203-
for (OutputSection *osec : ctx.outputSections)
2204-
if (osec->getPhdrFlags() == (PF_R | PF_X))
2205-
for (InputSection *sec : getInputSections(*osec, storage))
2206-
if (!isa<SyntheticSection>(sec))
2207-
reportUnless(sec->flags & purecodeFlag)
2208-
<< "-z execute-only-report: " << sec << " does not have "
2209-
<< purecodeFlagName << " flag set";
2203+
for (OutputSection *osec : ctx.outputSections) {
2204+
if (osec->getPhdrFlags() != (PF_R | PF_X))
2205+
continue;
2206+
for (InputSection *sec : getInputSections(*osec, storage)) {
2207+
if (isa<SyntheticSection>(sec))
2208+
continue;
2209+
reportUnless(sec->flags & purecodeFlag)
2210+
<< "-z execute-only-report: " << sec << " does not have "
2211+
<< purecodeFlagName << " flag set";
2212+
}
2213+
}
22102214
}
22112215

22122216
// The linker is expected to define SECNAME_start and SECNAME_end

0 commit comments

Comments
 (0)