Added exe package to manage sections

This commit is contained in:
Eduard Urbach 2025-03-08 22:14:24 +01:00
parent 955461d2de
commit 4faab9606c
Signed by: eduard
GPG key ID: 49226B848C78F6C8
16 changed files with 207 additions and 134 deletions

15
src/macho/cpu.go Normal file
View file

@ -0,0 +1,15 @@
package macho
import "git.urbach.dev/cli/q/src/config"
// cpu returns the CPU architecture used in the Mach-O header.
func cpu() (CPU, uint32) {
switch config.TargetArch {
case config.ARM:
return CPU_ARM_64, CPU_SUBTYPE_ARM64_ALL | 0x80000000
case config.X86:
return CPU_X86_64, CPU_SUBTYPE_X86_64_ALL | 0x80000000
default:
panic("unknown architecture")
}
}