Skip to content

Commit f8e5ddc

Browse files
lhamesAnthonyLatsis
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 (cherry picked from commit a655fbe)
1 parent 054ce11 commit f8e5ddc

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
@@ -375,14 +375,7 @@ template <typename ELFT> Error ELFLinkGraphBuilder<ELFT>::graphifySections() {
375375
}
376376
}
377377

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

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

0 commit comments

Comments
 (0)