
/****************************************************************************
 *
 *  (C) 1999 ARTX INC..  ALL RIGHTS RESERVED.  UNPUBLISHED -- RIGHTS
 *  RESERVED UNDER THE COPYRIGHT LAWS OF THE UNITED STATES.  USE OF A
 *  COPYRIGHT NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
 *  OR DISCLOSURE.
 *
 *  THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF
 *  ARTX INC..  USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT
 *  THE PRIOR EXPRESS WRITTEN PERMISSION OF ARTX INC..
 *
 *                  RESTRICTED RIGHTS LEGEND
 *
 *  Use, duplication, or disclosure by the Government is subject to
 *  restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
 *  in Technical Data and Computer Software clause at DFARS 252.227-7013
 *  or subparagraphs (c)(1) and (2) of Commercial Computer Software --
 *  Restricted Rights at 48 CFR 52.227-19, as applicable. 
 *
 *  ArtX Inc.
 *  3400 Hillview Ave, Bldg 5
 *  Palo Alto, CA 94304
 *
 ***************************************************************************/

#ifndef __ELF_H__
#define __ELF_H__       1

#include "types.h"


#define EI_NIDENT       16
#define EI_ORDER        5

#define ET_REL          1
#define ET_EXEC         2       /* The only type we're interested in. */

struct elfHdr_s {
    u8       e_ident[EI_NIDENT];
    u16      e_type;
    u16      e_machine;
    u32      e_version;
    u32      e_entry;
    u32      e_phoff;
    u32      e_shoff;
    u32      e_flags;
    u16      e_ehsize;
    u16      e_phentsize;
    u16      e_phnum;
    u16      e_shentsize;
    u16      e_shnum;
    u16      e_shstrndx;
};
typedef struct elfHdr_s ElfHdr;

struct elfPrgHdr_s {
    u32      p_type;
    u32      p_offset;
    u32      p_vaddr;
    u32      p_paddr;
    u32      p_filesz;
    u32      p_memsz;
    u32      p_flags;
    u32      p_align;
};
typedef struct elfPrgHdr_s ElfPrgHdr;

#define PT_LOAD         1       /* Only kind we're interested in. */

#define PF_X            0x1
#define PF_W            0x2
#define PF_R            0x4

#endif /* __ELF_H__ */
