This commit is contained in:
parent
3f481d0bd3
commit
85cea5cbee
15 changed files with 48 additions and 47 deletions
|
@ -19,7 +19,7 @@ type MachO struct {
|
|||
|
||||
// Write writes the Mach-O format to the given writer.
|
||||
func Write(writer io.WriteSeeker, b *build.Build, codeBytes []byte, dataBytes []byte) {
|
||||
x := exe.New(HeaderEnd, b.FileAlign, b.MemoryAlign)
|
||||
x := exe.New(HeaderEnd, b.FileAlign(), b.MemoryAlign())
|
||||
x.InitSections(codeBytes, dataBytes)
|
||||
code := x.Sections[0]
|
||||
data := x.Sections[1]
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func TestWrite(t *testing.T) {
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.ARM, FileAlign: 0x4000, MemoryAlign: 0x4000}, nil, nil)
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.X86, FileAlign: 0x1000, MemoryAlign: 0x1000}, nil, nil)
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.UnknownArch, FileAlign: 0x1000, MemoryAlign: 0x1000}, nil, nil)
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.ARM}, nil, nil)
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.X86}, nil, nil)
|
||||
macho.Write(&exe.Discard{}, &build.Build{Arch: build.UnknownArch}, nil, nil)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue