gem5/arch/alpha/aout_machdep.h
Steve Reinhardt e475dba424 New loader structure. Expand Nate's ObjectFile to automatically detect file formats
and generate an appropriate child object, which knows how to load its text & data into memory
(and symbols, for ecoff only at this point).  Ecoff format supports Tru64 binaries, kernel, and
console.  A.out format is used by PAL code.  Elf support is there and appears to work for
Alpha/Linux binaries, but awaits a Linux syscall emulation layer before further testing.

arch/alpha/ecoff_machdep.h:
base/coff_sym.h:
base/coff_symconst.h:
base/exec_ecoff.h:
    Add Id string & provenance comment, clean up types
base/object_file.cc:
base/object_file.hh:
    Add auto format detection and text/data loading.
sim/prog.cc:
    Moved binary loading & stack setup here (was in arch/alpha/loader.cc).  Some of this is
    platform-dependent, but I think most of it is not.  We'll factor out the platform-dependent
    parts when the need arises.
sim/prog.hh:
    Get rid of unused environ_base field.
sim/system.cc:
    Use new ObjectFile loader structure for console, kernel, & palcode.

--HG--
extra : convert_revision : 8eae509bf71cf204bc3ec78c68699cfd01baed97
2003-10-07 23:13:01 -07:00

42 lines
991 B
C

/* $Id$ */
#ifndef __AOUT_MACHDEP_H__
#define __AOUT_MACHDEP_H__
///
/// Funky Alpha 64-bit a.out header used for PAL code.
///
struct aout_exechdr {
uint16_t magic;
uint16_t vstamp;
uint16_t bldrev;
uint16_t padcell;
uint64_t tsize; // text segment size
uint64_t dsize; // data segment size
uint64_t bsize; // bss segment size
uint64_t entry; // entry point
uint64_t text_start; // text base address
uint64_t data_start; // data base address
uint64_t bss_start; // bss base address
uint32_t gprmask;
uint32_t fprmask;
uint64_t gp_value;
};
#define AOUT_LDPGSZ 8192
#define N_GETMAGIC(ex) ((ex).magic)
#define N_BADMAX
#define N_TXTADDR(ex) ((ex).text_start)
#define N_DATADDR(ex) ((ex).data_start)
#define N_BSSADDR(ex) ((ex).bss_start)
#define N_TXTOFF(ex) \
(N_GETMAGIC(ex) == ZMAGIC ? 0 : sizeof(struct aout_exechdr))
#define N_DATOFF(ex) N_ALIGN(ex, N_TXTOFF(ex) + (ex).tsize)
#endif /* !__AOUT_MACHDEP_H__*/