Skip to content

Commit a655fbe

Browse files
lhamesbnbarham
authored andcommitted
[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 (cherry picked from commit ead32e1) Conflicts: llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
1 parent 2f53a4c commit a655fbe

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h

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

377-
if (GraphSec->getMemProt() != Prot) {
378-
std::string ErrMsg;
379-
raw_string_ostream(ErrMsg)
380-
<< "In " << G->getName() << ", section " << *Name
381-
<< " is present more than once with different permissions: "
382-
<< GraphSec->getMemProt() << " vs " << Prot;
383-
return make_error<JITLinkError>(std::move(ErrMsg));
384-
}
377+
GraphSec->setMemProt(GraphSec->getMemProt() | Prot);
385378

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

0 commit comments

Comments
 (0)