[JITLink][ELF] Only make sections with SHF_WRITE writable
authorJob Noorman <jnoorman@igalia.com>
Mon, 3 Apr 2023 18:18:19 +0000 (20:18 +0200)
committerJob Noorman <jnoorman@igalia.com>
Mon, 3 Apr 2023 18:18:27 +0000 (20:18 +0200)
commite9b394b08eb6db5aa225441cf3fb9d4380ff4533
treebd0974d1e20a0a19afde971c6b490f200904c831
parentbc2b1614081c23b3c42917538fa54d67917c998f
[JITLink][ELF] Only make sections with SHF_WRITE writable

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

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D147442
llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h