summaryrefslogtreecommitdiff
path: root/src/pkg/debug/macho/macho.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/debug/macho/macho.go')
-rw-r--r--src/pkg/debug/macho/macho.go23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/pkg/debug/macho/macho.go b/src/pkg/debug/macho/macho.go
index bc14226c5..d9678c8ed 100644
--- a/src/pkg/debug/macho/macho.go
+++ b/src/pkg/debug/macho/macho.go
@@ -26,29 +26,40 @@ const (
)
const (
- Magic32 uint32 = 0xfeedface
- Magic64 uint32 = 0xfeedfacf
+ Magic32 uint32 = 0xfeedface
+ Magic64 uint32 = 0xfeedfacf
+ MagicFat uint32 = 0xcafebabe
)
-// A Type is a Mach-O file type, either an object or an executable.
+// A Type is the Mach-O file type, e.g. an object file, executable, or dynamic library.
type Type uint32
const (
- TypeObj Type = 1
- TypeExec Type = 2
+ TypeObj Type = 1
+ TypeExec Type = 2
+ TypeDylib Type = 6
+ TypeBundle Type = 8
)
// A Cpu is a Mach-O cpu type.
type Cpu uint32
+const cpuArch64 = 0x01000000
+
const (
Cpu386 Cpu = 7
- CpuAmd64 Cpu = Cpu386 + 1<<24
+ CpuAmd64 Cpu = Cpu386 | cpuArch64
+ CpuArm Cpu = 12
+ CpuPpc Cpu = 18
+ CpuPpc64 Cpu = CpuPpc | cpuArch64
)
var cpuStrings = []intName{
{uint32(Cpu386), "Cpu386"},
{uint32(CpuAmd64), "CpuAmd64"},
+ {uint32(CpuArm), "CpuArm"},
+ {uint32(CpuPpc), "CpuPpc"},
+ {uint32(CpuPpc64), "CpuPpc64"},
}
func (i Cpu) String() string { return stringName(uint32(i), cpuStrings, false) }