Added segment flags for the read-only segment in Mach-O
All checks were successful
/ test (push) Successful in 19s
All checks were successful
/ test (push) Successful in 19s
This commit is contained in:
parent
c7375c2ca0
commit
7fe9efae21
4 changed files with 11 additions and 4 deletions
|
@ -71,7 +71,7 @@ func Write(writer io.WriteSeeker, b *build.Build, codeBytes []byte, dataBytes []
|
|||
Size: uint64(len(code.Bytes)),
|
||||
Offset: uint32(code.FileOffset),
|
||||
Align: 6,
|
||||
Flags: FlagPureInstructions,
|
||||
Flags: SectionPureInstructions,
|
||||
},
|
||||
DataSegment: Segment64{
|
||||
LoadCommand: LcSegment64,
|
||||
|
@ -82,7 +82,7 @@ func Write(writer io.WriteSeeker, b *build.Build, codeBytes []byte, dataBytes []
|
|||
Offset: uint64(data.FileOffset),
|
||||
SizeInFile: uint64(len(data.Bytes)),
|
||||
NumSections: 0,
|
||||
Flag: 0,
|
||||
Flag: SegmentReadOnly,
|
||||
MaxProt: ProtReadable,
|
||||
InitProt: ProtReadable,
|
||||
},
|
||||
|
|
|
@ -3,5 +3,5 @@ package macho
|
|||
type SectionFlags uint32
|
||||
|
||||
const (
|
||||
FlagPureInstructions SectionFlags = 0x80000000
|
||||
SectionPureInstructions SectionFlags = 0x80000000
|
||||
)
|
|
@ -14,5 +14,5 @@ type Segment64 struct {
|
|||
MaxProt Prot
|
||||
InitProt Prot
|
||||
NumSections uint32
|
||||
Flag uint32
|
||||
Flag SegmentFlags
|
||||
}
|
7
src/macho/SegmentFlags.go
Normal file
7
src/macho/SegmentFlags.go
Normal file
|
@ -0,0 +1,7 @@
|
|||
package macho
|
||||
|
||||
type SegmentFlags uint32
|
||||
|
||||
const (
|
||||
SegmentReadOnly SegmentFlags = 0x10
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue