Added exe package to manage sections
This commit is contained in:
parent
955461d2de
commit
4faab9606c
16 changed files with 207 additions and 134 deletions
15
src/macho/cpu.go
Normal file
15
src/macho/cpu.go
Normal 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")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue