Alien-TinyCC

 view release on metacpan or  search on metacpan

src/elf.h  view on Meta::CPAN

/* The following are non-official names and should not be used.  */

#define E_MIPS_ARCH_1     0x00000000    /* -mips1 code.  */
#define E_MIPS_ARCH_2     0x10000000    /* -mips2 code.  */
#define E_MIPS_ARCH_3     0x20000000    /* -mips3 code.  */
#define E_MIPS_ARCH_4     0x30000000    /* -mips4 code.  */
#define E_MIPS_ARCH_5     0x40000000    /* -mips5 code.  */

/* Special section indices.  */

#define SHN_MIPS_ACOMMON 0xff00         /* Allocated common symbols */
#define SHN_MIPS_TEXT    0xff01         /* Allocated test symbols.  */
#define SHN_MIPS_DATA    0xff02         /* Allocated data symbols.  */
#define SHN_MIPS_SCOMMON 0xff03         /* Small common symbols */
#define SHN_MIPS_SUNDEFINED 0xff04      /* Small undefined symbols */

/* Legal values for sh_type field of Elf32_Shdr.  */

#define SHT_MIPS_LIBLIST       0x70000000 /* Shared objects used in link */
#define SHT_MIPS_MSYM          0x70000001
#define SHT_MIPS_CONFLICT      0x70000002 /* Conflicting symbols */
#define SHT_MIPS_GPTAB         0x70000003 /* Global data area sizes */
#define SHT_MIPS_UCODE         0x70000004 /* Reserved for SGI/MIPS compilers */
#define SHT_MIPS_DEBUG         0x70000005 /* MIPS ECOFF debugging information*/
#define SHT_MIPS_REGINFO       0x70000006 /* Register usage information */
#define SHT_MIPS_PACKAGE       0x70000007
#define SHT_MIPS_PACKSYM       0x70000008
#define SHT_MIPS_RELD          0x70000009
#define SHT_MIPS_IFACE         0x7000000b
#define SHT_MIPS_CONTENT       0x7000000c
#define SHT_MIPS_OPTIONS       0x7000000d /* Miscellaneous options.  */
#define SHT_MIPS_SHDR          0x70000010
#define SHT_MIPS_FDESC         0x70000011
#define SHT_MIPS_EXTSYM        0x70000012
#define SHT_MIPS_DENSE         0x70000013
#define SHT_MIPS_PDESC         0x70000014
#define SHT_MIPS_LOCSYM        0x70000015
#define SHT_MIPS_AUXSYM        0x70000016
#define SHT_MIPS_OPTSYM        0x70000017
#define SHT_MIPS_LOCSTR        0x70000018
#define SHT_MIPS_LINE          0x70000019
#define SHT_MIPS_RFDESC        0x7000001a
#define SHT_MIPS_DELTASYM      0x7000001b
#define SHT_MIPS_DELTAINST     0x7000001c
#define SHT_MIPS_DELTACLASS    0x7000001d
#define SHT_MIPS_DWARF         0x7000001e /* DWARF debugging information.  */
#define SHT_MIPS_DELTADECL     0x7000001f
#define SHT_MIPS_SYMBOL_LIB    0x70000020
#define SHT_MIPS_EVENTS        0x70000021 /* Event section.  */
#define SHT_MIPS_TRANSLATE     0x70000022
#define SHT_MIPS_PIXIE         0x70000023
#define SHT_MIPS_XLATE         0x70000024
#define SHT_MIPS_XLATE_DEBUG   0x70000025
#define SHT_MIPS_WHIRL         0x70000026
#define SHT_MIPS_EH_REGION     0x70000027
#define SHT_MIPS_XLATE_OLD     0x70000028
#define SHT_MIPS_PDR_EXCEPTION 0x70000029

/* Legal values for sh_flags field of Elf32_Shdr.  */

#define SHF_MIPS_GPREL   0x10000000     /* Must be part of global data area */
#define SHF_MIPS_MERGE   0x20000000
#define SHF_MIPS_ADDR    0x40000000
#define SHF_MIPS_STRINGS 0x80000000
#define SHF_MIPS_NOSTRIP 0x08000000
#define SHF_MIPS_LOCAL   0x04000000
#define SHF_MIPS_NAMES   0x02000000
#define SHF_MIPS_NODUPE  0x01000000


/* Symbol tables.  */

/* MIPS specific values for `st_other'.  */
#define STO_MIPS_DEFAULT                0x0
#define STO_MIPS_INTERNAL               0x1
#define STO_MIPS_HIDDEN                 0x2
#define STO_MIPS_PROTECTED              0x3
#define STO_MIPS_SC_ALIGN_UNUSED        0xff

/* MIPS specific values for `st_info'.  */
#define STB_MIPS_SPLIT_COMMON           13

/* Entries found in sections of type SHT_MIPS_GPTAB.  */

typedef union
{
  struct
    {
      Elf32_Word gt_current_g_value;    /* -G value used for compilation */
      Elf32_Word gt_unused;             /* Not used */
    } gt_header;                        /* First entry in section */
  struct
    {
      Elf32_Word gt_g_value;            /* If this value were used for -G */
      Elf32_Word gt_bytes;              /* This many bytes would be used */
    } gt_entry;                         /* Subsequent entries in section */
} Elf32_gptab;

/* Entry found in sections of type SHT_MIPS_REGINFO.  */

typedef struct
{
  Elf32_Word    ri_gprmask;             /* General registers used */
  Elf32_Word    ri_cprmask[4];          /* Coprocessor registers used */
  Elf32_Sword   ri_gp_value;            /* $gp register value */
} Elf32_RegInfo;

/* Entries found in sections of type SHT_MIPS_OPTIONS.  */

typedef struct
{
  unsigned char kind;           /* Determines interpretation of the
                                   variable part of descriptor.  */
  unsigned char size;           /* Size of descriptor, including header.  */
  Elf32_Section section;        /* Section header index of section affected,
                                   0 for global options.  */
  Elf32_Word info;              /* Kind-specific information.  */
} Elf_Options;

/* Values for `kind' field in Elf_Options.  */

#define ODK_NULL        0       /* Undefined.  */
#define ODK_REGINFO     1       /* Register usage information.  */
#define ODK_EXCEPTIONS  2       /* Exception processing options.  */
#define ODK_PAD         3       /* Section padding options.  */
#define ODK_HWPATCH     4       /* Hardware workarounds performed */
#define ODK_FILL        5       /* record the fill value used by the linker. */
#define ODK_TAGS        6       /* reserve space for desktop tools to write. */
#define ODK_HWAND       7       /* HW workarounds.  'AND' bits when merging. */
#define ODK_HWOR        8       /* HW workarounds.  'OR' bits when merging.  */

/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries.  */

#define OEX_FPU_MIN     0x1f    /* FPE's which MUST be enabled.  */
#define OEX_FPU_MAX     0x1f00  /* FPE's which MAY be enabled.  */
#define OEX_PAGE0       0x10000 /* page zero must be mapped.  */
#define OEX_SMM         0x20000 /* Force sequential memory mode?  */
#define OEX_FPDBUG      0x40000 /* Force floating point debug mode?  */
#define OEX_PRECISEFP   OEX_FPDBUG
#define OEX_DISMISS     0x80000 /* Dismiss invalid address faults?  */

#define OEX_FPU_INVAL   0x10
#define OEX_FPU_DIV0    0x08
#define OEX_FPU_OFLO    0x04
#define OEX_FPU_UFLO    0x02
#define OEX_FPU_INEX    0x01

/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry.  */

#define OHW_R4KEOP      0x1     /* R4000 end-of-page patch.  */
#define OHW_R8KPFETCH   0x2     /* may need R8000 prefetch patch.  */
#define OHW_R5KEOP      0x4     /* R5000 end-of-page patch.  */
#define OHW_R5KCVTL     0x8     /* R5000 cvt.[ds].l bug.  clean=1.  */

#define OPAD_PREFIX     0x1
#define OPAD_POSTFIX    0x2
#define OPAD_SYMBOL     0x4

/* Entry found in `.options' section.  */

typedef struct
{
  Elf32_Word hwp_flags1;        /* Extra flags.  */
  Elf32_Word hwp_flags2;        /* Extra flags.  */
} Elf_Options_Hw;

/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries.  */

#define OHWA0_R4KEOP_CHECKED    0x00000001
#define OHWA1_R4KEOP_CLEAN      0x00000002

/* MIPS relocs.  */

#define R_MIPS_NONE             0       /* No reloc */
#define R_MIPS_16               1       /* Direct 16 bit */
#define R_MIPS_32               2       /* Direct 32 bit */

src/elf.h  view on Meta::CPAN

#define RHF_REQUICKSTART           (1 << 10)
#define RHF_REQUICKSTARTED         (1 << 11)
#define RHF_CORD                   (1 << 12)
#define RHF_NO_UNRES_UNDEF         (1 << 13)
#define RHF_RLD_ORDER_SAFE         (1 << 14)

/* Entries found in sections of type SHT_MIPS_LIBLIST.  */

typedef struct
{
  Elf32_Word l_name;            /* Name (string table index) */
  Elf32_Word l_time_stamp;      /* Timestamp */
  Elf32_Word l_checksum;        /* Checksum */
  Elf32_Word l_version;         /* Interface version */
  Elf32_Word l_flags;           /* Flags */
} Elf32_Lib;

typedef struct
{
  Elf64_Word l_name;            /* Name (string table index) */
  Elf64_Word l_time_stamp;      /* Timestamp */
  Elf64_Word l_checksum;        /* Checksum */
  Elf64_Word l_version;         /* Interface version */
  Elf64_Word l_flags;           /* Flags */
} Elf64_Lib;


/* Legal values for l_flags.  */

#define LL_NONE           0
#define LL_EXACT_MATCH    (1 << 0)      /* Require exact match */
#define LL_IGNORE_INT_VER (1 << 1)      /* Ignore interface version */
#define LL_REQUIRE_MINOR  (1 << 2)
#define LL_EXPORTS        (1 << 3)
#define LL_DELAY_LOAD     (1 << 4)
#define LL_DELTA          (1 << 5)

/* Entries found in sections of type SHT_MIPS_CONFLICT.  */

typedef Elf32_Addr Elf32_Conflict;


/* HPPA specific definitions.  */

/* Legal values for e_flags field of Elf32_Ehdr.  */

#define EF_PARISC_TRAPNL        1       /* Trap nil pointer dereference.  */
#define EF_PARISC_EXT           2       /* Program uses arch. extensions.  */
#define EF_PARISC_ARCH          0xffff0000 /* Architecture version.  */
/* Defined values are:
                                0x020b  PA-RISC 1.0 big-endian
                                0x0210  PA-RISC 1.1 big-endian
                                0x028b  PA-RISC 1.0 little-endian
                                0x0290  PA-RISC 1.1 little-endian
*/

/* Legal values for sh_type field of Elf32_Shdr.  */

#define SHT_PARISC_GOT          0x70000000 /* GOT for external data.  */
#define SHT_PARISC_ARCH         0x70000001 /* Architecture extensions.  */
#define SHT_PARISC_GLOBAL       0x70000002 /* Definition of $global$.  */
#define SHT_PARISC_MILLI        0x70000003 /* Millicode routines.  */
#define SHT_PARISC_UNWIND       0x70000004 /* Unwind information.  */
#define SHT_PARISC_PLT          0x70000005 /* Procedure linkage table.  */
#define SHT_PARISC_SDATA        0x70000006 /* Short initialized data.  */
#define SHT_PARISC_SBSS         0x70000007 /* Short uninitialized data.  */
#define SHT_PARISC_SYMEXTN      0x70000008 /* Argument/relocation info.  */
#define SHT_PARISC_STUBS        0x70000009 /* Linker stubs.  */

/* Legal values for sh_flags field of Elf32_Shdr.  */

#define SHF_PARISC_GLOBAL       0x10000000 /* Section defines dp.  */
#define SHF_PARISC_SHORT        0x20000000 /* Section with short addressing. */

/* Legal values for ST_TYPE subfield of st_info (symbol type).  */

#define STT_PARISC_MILLICODE    13      /* Millicode function entry point.  */

/* HPPA relocs.  */

#define R_PARISC_NONE           0       /* No reloc.  */
#define R_PARISC_DIR32          1       /* Direct 32-bit reference.  */
#define R_PARISC_DIR21L         2       /* Left 21 bits of eff. address.  */
#define R_PARISC_DIR17R         3       /* Right 17 bits of eff. address.  */
#define R_PARISC_DIR14R         4       /* Right 14 bits of eff. address.  */
#define R_PARISC_PCREL21L       5       /* PC-relative, left 21 bits.  */
#define R_PARISC_PCREL14R       6       /* PC-relative, right 14 bits.  */
#define R_PARISC_PCREL17C       7       /* Conditional PC-relative, ignore
                                           if displacement > 17bits.  */
#define R_PARISC_PCREL17F       8       /* Conditional PC-relative, must
                                           fit in 17bits.  */
#define R_PARISC_DPREL21L       9       /* DP-relative, left 21 bits.  */
#define R_PARISC_DPREL14R       10      /* DP-relative, right 14 bits.  */
#define R_PARISC_DPREL14F       11      /* DP-relative, must bit in 14 bits. */
#define R_PARISC_DLTREL21L      12      /* DLT-relative, left 21 bits.  */
#define R_PARISC_DLTREL14R      13      /* DLT-relative, right 14 bits.  */
#define R_PARISC_DLTREL14F      14      /* DLT-relative, must fit in 14 bits.*/
#define R_PARISC_DLTIND21L      15      /* DLT-relative indirect, left
                                           21 bits.  */
#define R_PARISC_DLTIND14R      16      /* DLT-relative indirect, right
                                           14 bits.  */
#define R_PARISC_DLTIND14F      17      /* DLT-relative indirect, must fit
                                           int 14 bits.  */
#define R_PARISC_PLABEL32       18      /* Direct 32-bit reference to proc.  */

/* Alpha specific definitions.  */

/* Legal values for e_flags field of Elf64_Ehdr.  */

#define EF_ALPHA_32BIT          1       /* All addresses must be < 2GB.  */
#define EF_ALPHA_CANRELAX       2       /* Relocations for relaxing exist.  */

/* Legal values for sh_type field of Elf64_Shdr.  */

/* These two are primerily concerned with ECOFF debugging info.  */
#define SHT_ALPHA_DEBUG         0x70000001
#define SHT_ALPHA_REGINFO       0x70000002

/* Legal values for sh_flags field of Elf64_Shdr.  */

#define SHF_ALPHA_GPREL         0x10000000



( run in 0.421 second using v1.01-cache-2.11-cpan-ceb78f64989 )