[PATCH] D118494: [lldb] Observe SG_READ_ONLY flag in MachO binaries

Augusto Noronha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 28 12:38:16 PST 2022


augusto2112 requested changes to this revision.
augusto2112 added inline comments.
This revision now requires changes to proceed.


================
Comment at: lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp:1436
     result |= ePermissionsReadable;
-  if (seg_cmd.initprot & VM_PROT_WRITE)
+  if ((seg_cmd.initprot & VM_PROT_WRITE) && !(seg_cmd.flags & SG_READ_ONLY))
     result |= ePermissionsWritable;
----------------
Could we add a new value in the enumeration? Something like ePermissionsLinkerWritable? As it is right now this would be dangerous for the existing file-cache optimization as we'd happily read pointers that are supposed to be fixed by the linker from the file-cache.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118494/new/

https://reviews.llvm.org/D118494



More information about the llvm-commits mailing list