a.out.h File Reference

Go to the source code of this file.

Data Structures

struct  exec
struct  nlist
struct  relocation_info

Defines

#define __GNU_EXEC_MACROS__
#define N_MAGIC(exec)   ((exec).a_info & 0xffff)
#define N_MACHTYPE(exec)   ((enum machine_type)(((exec).a_info >> 16) & 0xff))
#define N_FLAGS(exec)   (((exec).a_info >> 24) & 0xff)
#define N_SET_INFO(exec, magic, type, flags)
#define N_SET_MAGIC(exec, magic)   ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
#define N_SET_MACHTYPE(exec, machtype)
#define N_SET_FLAGS(exec, flags)
#define OMAGIC   0407
 Code indicating object file or impure executable.
#define NMAGIC   0410
 Code indicating pure executable.
#define ZMAGIC   0413
 Code indicating demand-paged executable.
#define QMAGIC   0314
#define CMAGIC   0421
 Code indicating core file.
#define N_BADMAG(x)
#define _N_HDROFF(x)   (1024 - sizeof (struct exec))
#define N_TXTOFF(x)
#define N_DATOFF(x)   (N_TXTOFF(x) + (x).a_text)
#define N_TRELOFF(x)   (N_DATOFF(x) + (x).a_data)
#define N_DRELOFF(x)   (N_TRELOFF(x) + (x).a_trsize)
#define N_SYMOFF(x)   (N_DRELOFF(x) + (x).a_drsize)
#define N_STROFF(x)   (N_SYMOFF(x) + (x).a_syms)
#define N_TXTADDR(x)   (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
 Address of text segment in memory after it is loaded.
#define _N_SEGMENT_ROUND(x)   (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))
#define _N_TXTENDADDR(x)   (N_TXTADDR(x)+(x).a_text)
#define N_DATADDR(x)
#define N_BSSADDR(x)   (N_DATADDR(x) + (x).a_data)
 Address of bss segment in memory after it is loaded.
#define N_UNDF   0
#define N_ABS   2
#define N_TEXT   4
#define N_DATA   6
#define N_BSS   8
#define N_FN   15
#define N_EXT   1
#define N_TYPE   036
#define N_STAB   0340
#define N_INDR   0xa
#define N_SETA   0x14
 These appear as input to LD, in a .o file. Absolute set element symbol.
#define N_SETT   0x16
 Text set element symbol.
#define N_SETD   0x18
 Data set element symbol.
#define N_SETB   0x1A
 Bss set element symbol.
#define N_SETV   0x1C
 This is output from LD. Pointer to set vector in data area.

Enumerations

enum  machine_type {
  M_OLDSUN2 = 0, M_68010 = 1, M_68020 = 2, M_SPARC = 3,
  M_386 = 100
}
 these go in the N_MACHTYPE field More...


Define Documentation

#define __GNU_EXEC_MACROS__

Definition at line 4 of file a.out.h.

#define _N_HDROFF (  )     (1024 - sizeof (struct exec))

Definition at line 92 of file a.out.h.

#define _N_SEGMENT_ROUND (  )     (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1))

Address of data segment in memory after it is loaded. Note that it is up to you to define SEGMENT_SIZE

Definition at line 151 of file a.out.h.

#define _N_TXTENDADDR (  )     (N_TXTADDR(x)+(x).a_text)

Definition at line 153 of file a.out.h.

#define CMAGIC   0421

Code indicating core file.

Definition at line 83 of file a.out.h.

#define N_ABS   2

Definition at line 184 of file a.out.h.

#define N_BADMAG (  ) 

Value:

(N_MAGIC(x) != OMAGIC           \
                        && N_MAGIC(x) != NMAGIC         \
                        && N_MAGIC(x) != ZMAGIC \
                        && N_MAGIC(x) != QMAGIC)

Definition at line 86 of file a.out.h.

#define N_BSS   8

Definition at line 193 of file a.out.h.

#define N_BSSADDR (  )     (N_DATADDR(x) + (x).a_data)

Address of bss segment in memory after it is loaded.

Definition at line 163 of file a.out.h.

#define N_DATA   6

Definition at line 190 of file a.out.h.

#define N_DATADDR (  ) 

Value:

Definition at line 156 of file a.out.h.

#define N_DATOFF (  )     (N_TXTOFF(x) + (x).a_text)

Definition at line 101 of file a.out.h.

#define N_DRELOFF (  )     (N_TRELOFF(x) + (x).a_trsize)

Definition at line 109 of file a.out.h.

#define N_EXT   1

Definition at line 200 of file a.out.h.

#define N_FLAGS ( exec   )     (((exec).a_info >> 24) & 0xff)

Definition at line 52 of file a.out.h.

#define N_FN   15

Definition at line 196 of file a.out.h.

#define N_INDR   0xa

The following type indicates the definition of a symbol as being an indirect reference to another symbol. The other symbol appears as an undefined reference, immediately following this symbol.

Indirection is asymmetrical. The other symbol's value will be used to satisfy requests for the indirect symbol, but not vice versa. If the other symbol does not have a definition, libraries will

Definition at line 221 of file a.out.h.

#define N_MACHTYPE ( exec   )     ((enum machine_type)(((exec).a_info >> 16) & 0xff))

Definition at line 51 of file a.out.h.

#define N_MAGIC ( exec   )     ((exec).a_info & 0xffff)

Definition at line 49 of file a.out.h.

#define N_SET_FLAGS ( exec,
flags   ) 

Value:

((exec).a_info = \
         ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))

Definition at line 64 of file a.out.h.

#define N_SET_INFO ( exec,
magic,
type,
flags   ) 

Value:

((exec).a_info = ((magic) & 0xffff) \
         | (((int)(type) & 0xff) << 16) \
         | (((flags) & 0xff) << 24))

Definition at line 53 of file a.out.h.

#define N_SET_MACHTYPE ( exec,
machtype   ) 

Value:

((exec).a_info = \
         ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))

Definition at line 60 of file a.out.h.

#define N_SET_MAGIC ( exec,
magic   )     ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))

Definition at line 57 of file a.out.h.

#define N_SETA   0x14

These appear as input to LD, in a .o file. Absolute set element symbol.

The following symbols refer to set elements. All the N_SET[ATDB] symbols with the same name form one set. Space is allocated for the set in the text section, and each set element's value is stored into one word of the space. The first word of the space is the length of the set (number of elements).

The address of the set is made into an N_SETV symbol whose name is the same as the name of the set. This symbol acts like a N_DATA global symbol

Definition at line 239 of file a.out.h.

#define N_SETB   0x1A

Bss set element symbol.

Definition at line 242 of file a.out.h.

#define N_SETD   0x18

Data set element symbol.

Definition at line 241 of file a.out.h.

#define N_SETT   0x16

Text set element symbol.

Definition at line 240 of file a.out.h.

#define N_SETV   0x1C

This is output from LD. Pointer to set vector in data area.

Definition at line 245 of file a.out.h.

#define N_STAB   0340

Definition at line 206 of file a.out.h.

#define N_STROFF (  )     (N_SYMOFF(x) + (x).a_syms)

Definition at line 117 of file a.out.h.

#define N_SYMOFF (  )     (N_DRELOFF(x) + (x).a_drsize)

Definition at line 113 of file a.out.h.

#define N_TEXT   4

Definition at line 187 of file a.out.h.

#define N_TRELOFF (  )     (N_DATOFF(x) + (x).a_data)

Definition at line 105 of file a.out.h.

#define N_TXTADDR (  )     (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)

Address of text segment in memory after it is loaded.

Definition at line 122 of file a.out.h.

#define N_TXTOFF (  ) 

Value:

(N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) : \
  (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))

Definition at line 95 of file a.out.h.

#define N_TYPE   036

Definition at line 203 of file a.out.h.

#define N_UNDF   0

Definition at line 181 of file a.out.h.

#define NMAGIC   0410

Code indicating pure executable.

Definition at line 71 of file a.out.h.

#define OMAGIC   0407

Code indicating object file or impure executable.

Definition at line 69 of file a.out.h.

#define QMAGIC   0314

This indicates a demand-paged executable with the header in the text.

Definition at line 80 of file a.out.h.

#define ZMAGIC   0413

Code indicating demand-paged executable.

Definition at line 73 of file a.out.h.


Enumeration Type Documentation

enum machine_type

these go in the N_MACHTYPE field

Enumerator:
M_OLDSUN2 
M_68010 
M_68020 
M_SPARC 
M_386  skip a bunch so we don't run into any of sun's numbers

Definition at line 23 of file a.out.h.


Generated on Mon May 1 21:47:00 2006 for KernelAPI by  doxygen 1.4.6-5