This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][ELF] Only make sections with SHF_WRITE writable
ClosedPublic

Authored by jobnoorman on Apr 3 2023, 7:01 AM.

Details

Summary

All non-executable sections used to be mapped as RW- causing read-only
sections such as .rodata to be writable.

Note that this patch doesn't include a test case since it's not entirely
clear to me if it's possible to test MemProt flags.

Diff Detail

Event Timeline

jobnoorman created this revision.Apr 3 2023, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 7:01 AM
jobnoorman requested review of this revision.Apr 3 2023, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 7:01 AM
lhames accepted this revision.Apr 3 2023, 10:58 AM

LGTM. Thanks @jobnoorman!

This revision is now accepted and ready to land.Apr 3 2023, 10:58 AM