Skip to content

Commit ead32e1

Browse files
committed
[JITLink] Use the union of ELF section permissions rdar://114207428.
Swift is currently generating multiple .rodata sections with a combination of SHF_ALLOC and (SHF_ALLOC | SHF_WRITABLE) flags and this was tripping an assert in the ELFLinkGraphBuilder. As a temporary workaround this patch just uses the union of the requested permissions. rdar://114207428
1 parent 945c269 commit ead32e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ template <typename ELFT> Error ELFLinkGraphBuilder<ELFT>::graphifySections() {
374374
}
375375
}
376376

377-
assert(GraphSec->getMemProt() == Prot && "MemProt should match");
377+
GraphSec->setMemProt(GraphSec->getMemProt() | Prot);
378378

379379
Block *B = nullptr;
380380
if (Sec.sh_type != ELF::SHT_NOBITS) {

0 commit comments

Comments
 (0)