Reduced executable size on Linux
All checks were successful
/ test (push) Successful in 29s

This commit is contained in:
Eduard Urbach 2025-07-04 09:09:22 +02:00
parent ca9595d1fb
commit 36f76170f5
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
9 changed files with 48 additions and 20 deletions

View file

@ -19,8 +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.InitSections(codeBytes, dataBytes)
x := exe.New(HeaderEnd, b.FileAlign(), b.MemoryAlign(), b.Congruent(), codeBytes, dataBytes)
code := x.Sections[0]
data := x.Sections[1]
arch, microArch := Arch(b.Arch)