mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Add names for mach-o permissions bits and use the symbol names in place of magic numbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190013 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5afaf5d1c1
commit
a38c27be0f
@ -417,6 +417,15 @@ namespace llvm {
|
|||||||
X86_64_RELOC_TLV = 9
|
X86_64_RELOC_TLV = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Values for segment_command.initprot.
|
||||||
|
// From <mach/vm_prot.h>
|
||||||
|
enum {
|
||||||
|
VM_PROT_READ = 0x1,
|
||||||
|
VM_PROT_WRITE = 0x2,
|
||||||
|
VM_PROT_EXECUTE = 0x4
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Structs from <mach-o/loader.h>
|
// Structs from <mach-o/loader.h>
|
||||||
|
|
||||||
struct mach_header {
|
struct mach_header {
|
||||||
|
@ -185,8 +185,10 @@ void MachObjectWriter::WriteSegmentLoadCommand(unsigned NumSections,
|
|||||||
Write32(SectionDataStartOffset); // file offset
|
Write32(SectionDataStartOffset); // file offset
|
||||||
Write32(SectionDataSize); // file size
|
Write32(SectionDataSize); // file size
|
||||||
}
|
}
|
||||||
Write32(0x7); // maxprot
|
// maxprot
|
||||||
Write32(0x7); // initprot
|
Write32(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE);
|
||||||
|
// initprot
|
||||||
|
Write32(MachO::VM_PROT_READ | MachO::VM_PROT_WRITE | MachO::VM_PROT_EXECUTE);
|
||||||
Write32(NumSections);
|
Write32(NumSections);
|
||||||
Write32(0); // flags
|
Write32(0); // flags
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user