OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [a.out.h] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* Copyright (C) 1990-1996
2
 * This file is part of the ld86 command for Linux-86
3
 * It is distributed under the GNU Library General Public License.
4
 *
5
 * - This may actually be BSD or Minix code, can someone clarify please. -RDB
6
 */
7
 
8
#ifndef __AOUT_H
9
#define __AOUT_H
10
 
11
struct  exec {                  /* a.out header */
12
  unsigned char a_magic[2];     /* magic number */
13
  unsigned char a_flags;        /* flags, see below */
14
  unsigned char a_cpu;          /* cpu id */
15
  unsigned char a_hdrlen;       /* length of header */
16
  unsigned char a_unused;       /* reserved for future use */
17
  unsigned short a_version;     /* version stamp (not used at present) */
18
  long          a_text;         /* size of text segement in bytes */
19
  long          a_data;         /* size of data segment in bytes */
20
  long          a_bss;          /* size of bss segment in bytes */
21
  long          a_entry;        /* entry point */
22
  long          a_total;        /* total memory allocated */
23
  long          a_syms;         /* size of symbol table */
24
 
25
  /* SHORT FORM ENDS HERE */
26
  long          a_trsize;       /* text relocation size */
27
  long          a_drsize;       /* data relocation size */
28
  long          a_tbase;        /* text relocation base */
29
  long          a_dbase;        /* data relocation base */
30
};
31
 
32
#define A_MAGIC0      (unsigned char) 0x01
33
#define A_MAGIC1      (unsigned char) 0x03
34
#define BADMAG(X)     ((X).a_magic[0] != A_MAGIC0 ||(X).a_magic[1] != A_MAGIC1)
35
 
36
/* CPU Id of TARGET machine (byte order coded in low order two bits) */
37
#define A_NONE  0x00    /* unknown */
38
#define A_I8086 0x04    /* intel i8086/8088 */
39
#define A_M68K  0x0B    /* motorola m68000 */
40
#define A_NS16K 0x0C    /* national semiconductor 16032 */
41
#define A_I80386 0x10   /* intel i80386 */
42
#define A_SPARC 0x17    /* Sun SPARC */
43
 
44
#define A_BLR(cputype)  ((cputype&0x01)!=0) /* TRUE if bytes left-to-right */
45
#define A_WLR(cputype)  ((cputype&0x02)!=0) /* TRUE if words left-to-right */
46
 
47
/* Flags. */
48
#define A_UZP   0x01    /* unmapped zero page (pages) */
49
#define A_PAL   0x02    /* page aligned executable */
50
#define A_NSYM  0x04    /* new style symbol table */
51
#define A_EXEC  0x10    /* executable */
52
#define A_SEP   0x20    /* separate I/D */
53
#define A_PURE  0x40    /* pure text */
54
#define A_TOVLY 0x80    /* text overlay */
55
 
56
/* Offsets of various things. */
57
#define A_MINHDR        32
58
#define A_TEXTPOS(X)    ((long)(X).a_hdrlen)
59
#define A_DATAPOS(X)    (A_TEXTPOS(X) + (X).a_text)
60
#define A_HASRELS(X)    ((X).a_hdrlen > (unsigned char) A_MINHDR)
61
#define A_HASEXT(X)     ((X).a_hdrlen > (unsigned char) (A_MINHDR +  8))
62
#define A_HASLNS(X)     ((X).a_hdrlen > (unsigned char) (A_MINHDR + 16))
63
#define A_HASTOFF(X)    ((X).a_hdrlen > (unsigned char) (A_MINHDR + 24))
64
#define A_TRELPOS(X)    (A_DATAPOS(X) + (X).a_data)
65
#define A_DRELPOS(X)    (A_TRELPOS(X) + (X).a_trsize)
66
#define A_SYMPOS(X)     (A_TRELPOS(X) + (A_HASRELS(X) ? \
67
                        ((X).a_trsize + (X).a_drsize) : 0))
68
 
69
struct reloc {
70
  long r_vaddr;                 /* virtual address of reference */
71
  unsigned short r_symndx;      /* internal segnum or extern symbol num */
72
  unsigned short r_type;        /* relocation type */
73
};
74
 
75
/* r_tyep values: */
76
#define R_ABBS          0
77
#define R_RELLBYTE      2
78
#define R_PCRBYTE       3
79
#define R_RELWORD       4
80
#define R_PCRWORD       5
81
#define R_RELLONG       6
82
#define R_PCRLONG       7
83
#define R_REL3BYTE      8
84
#define R_KBRANCHE      9
85
 
86
/* r_symndx for internal segments */
87
#define S_ABS           ((unsigned short)-1)
88
#define S_TEXT          ((unsigned short)-2)
89
#define S_DATA          ((unsigned short)-3)
90
#define S_BSS           ((unsigned short)-4)
91
 
92
struct nlist {                  /* symbol table entry */
93
  char n_name[8];               /* symbol name */
94
  long n_value;                 /* value */
95
  unsigned char n_sclass;       /* storage class */
96
  unsigned char n_numaux;       /* number of auxiliary entries (not used) */
97
  unsigned short n_type;        /* language base and derived type (not used) */
98
};
99
 
100
/* Low bits of storage class (section). */
101
#define N_SECT            07    /* section mask */
102
#define N_UNDF            00    /* undefined */
103
#define N_ABS             01    /* absolute */
104
#define N_TEXT            02    /* text */
105
#define N_DATA            03    /* data */
106
#define N_BSS             04    /* bss */
107
#define N_COMM            05    /* (common) */
108
 
109
/* High bits of storage class. */
110
#define N_CLASS         0370    /* storage class mask */
111
#define C_NULL
112
#define C_EXT           0020    /* external symbol */
113
#define C_STAT          0030    /* static */
114
 
115
#endif /* _AOUT_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.