-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.out.pbl
105 lines (90 loc) · 2.9 KB
/
a.out.pbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/* This file describes the a.out file format
Copyright (C) 1987 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* JF I'm not sure where this file came from. I put the permit.text message in
it anyway. This file came to me as part of the original VAX assembler */
#define OMAGIC 0407
#define NMAGIC 0410
#define ZMAGIC 0413
#ifdef ti1500
#else
struct exec {
long a_magic; /* number identifies as .o file and gives type of such. */
unsigned a_text; /* length of text, in bytes */
unsigned a_data; /* length of data, in bytes */
unsigned a_bss; /* length of uninitialized data area for file, in bytes */
unsigned a_syms; /* length of symbol table data in file, in bytes */
unsigned a_entry; /* start address */
unsigned a_trsize; /* length of relocation info for text, in bytes */
unsigned a_drsize; /* length of relocation info for data, in bytes */
};
#define N_BADMAG(x) \
(((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
#define N_TXTOFF(x) \
((x).a_magic == ZMAGIC ? 1024 : sizeof(struct exec))
#define N_SYMOFF(x) \
(N_TXTOFF(x) + (x).a_text + (x).a_data + (x).a_trsize + (x).a_drsize)
#define N_STROFF(x) \
(N_SYMOFF(x) + (x).a_syms)
struct nlist {
union {
char *n_name;
struct nlist *n_next;
long n_strx;
} n_un;
char n_type;
char n_other;
short n_desc;
unsigned n_value;
};
#define N_UNDF 0
#define N_ABS 2
#define N_TEXT 4
#define N_DATA 6
#define N_BSS 8
#define N_FN 31 /* JF: Someone claims this should be 31 instead of
15. I just inherited this file; I didn't write
it. Who is right? */
#define N_EXT 1
#define N_TYPE 036
#define N_STAB 0340
#ifdef ti1500
struct reloc {
long r_vaddr; /* (virtual) address of reference */
long r_symndx; /* index into symbol table */
unsigned short r_type; /* relocation type */
};
/*
* DEC Processors VAX 11/780 and VAX 11/750
* Also, M68000
*
*/
#define R_RELBYTE 017
#define R_RELWORD 020
#define R_RELLONG 021
#define R_PCRBYTE 022
#define R_PCRWORD 023
#define R_PCRLONG 024
#else
struct relocation_info {
int r_address;
unsigned r_symbolnum:24,
r_pcrel:1,
r_length:2,
r_extern:1,
r_bsr:1, /* OVE: used on ns32k based systems, if you want */
r_disp:1, /* OVE: used on ns32k based systems, if you want */
nuthin:2;
};
#endif