| 1 |
// Copyright 2014 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
/* |
| 6 |
* Plan 9 a.out constants and data structures |
| 7 |
*/ |
| 8 |
|
| 9 |
package plan9obj |
| 10 |
|
| 11 |
// Plan 9 Program header. |
| 12 |
type prog struct { |
| 13 |
Magic uint32 /* magic number */ |
| 14 |
Text uint32 /* size of text segment */ |
| 15 |
Data uint32 /* size of initialized data */ |
| 16 |
Bss uint32 /* size of uninitialized data */ |
| 17 |
Syms uint32 /* size of symbol table */ |
| 18 |
Entry uint32 /* entry point */ |
| 19 |
Spsz uint32 /* size of pc/sp offset table */ |
| 20 |
Pcsz uint32 /* size of pc/line number table */ |
| 21 |
} |
| 22 |
|
| 23 |
// Plan 9 symbol table entries. |
| 24 |
type sym struct { |
| 25 |
value uint64 |
| 26 |
typ byte |
| 27 |
name []byte |
| 28 |
} |
| 29 |
|
| 30 |
const ( |
| 31 |
Magic64 = 0x8000 // 64-bit expanded header |
| 32 |
|
| 33 |
Magic386 = (4*11+0)*11 + 7 |
| 34 |
MagicAMD64 = (4*26+0)*26 + 7 + Magic64 |
| 35 |
MagicARM = (4*20+0)*20 + 7 |
| 36 |
) |