ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

elf-i386.h
Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1996-1997 John D. Polstra.
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  *
00014  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00015  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00017  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00018  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00019  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00020  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00021  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00022  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00023  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00024  * SUCH DAMAGE.
00025  *
00026  * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $
00027  */
00028 
00029 #ifndef _MACHINE_ELF_H_
00030 #define _MACHINE_ELF_H_ 1
00031 
00032 /*
00033  * ELF definitions for the i386 architecture.
00034  */
00035 
00036 #ifdef _REACTOS_ELF_MACHINE_IS_TARGET
00037 
00038 #ifndef __ELF_WORD_SIZE
00039 #define __ELF_WORD_SIZE 32  /* Used by <elf/generic.h> */
00040 #endif
00041 
00042 #include <elf/generic.h>
00043 
00044 #define ELF_ARCH    EM_386
00045 
00046 #define ELF_MACHINE_OK(x) ((x) == EM_386 || (x) == EM_486)
00047 
00048 /*
00049  * Auxiliary vector entries for passing information to the interpreter.
00050  *
00051  * The i386 supplement to the SVR4 ABI specification names this "auxv_t",
00052  * but POSIX lays claim to all symbols ending with "_t".
00053  */
00054 
00055 typedef struct {    /* Auxiliary vector entry on initial stack */
00056     int a_type;         /* Entry type. */
00057     union {
00058         long    a_val;      /* Integer value. */
00059         void    *a_ptr;     /* Address. */
00060         void    (*a_fcn)(void); /* Function pointer (not used). */
00061     } a_un;
00062 } Elf32_Auxinfo;
00063 
00064 #if __ELF_WORD_SIZE == 64
00065 /* Fake for amd64 loader support */
00066 typedef struct {
00067     int fake;
00068 } Elf64_Auxinfo;
00069 #endif
00070 
00071 __ElfType(Auxinfo);
00072 
00073 /* Values for a_type. */
00074 #define AT_NULL     0   /* Terminates the vector. */
00075 #define AT_IGNORE   1   /* Ignored entry. */
00076 #define AT_EXECFD   2   /* File descriptor of program to load. */
00077 #define AT_PHDR     3   /* Program header of program already loaded. */
00078 #define AT_PHENT    4   /* Size of each program header entry. */
00079 #define AT_PHNUM    5   /* Number of program header entries. */
00080 #define AT_PAGESZ   6   /* Page size in bytes. */
00081 #define AT_BASE     7   /* Interpreter's base address. */
00082 #define AT_FLAGS    8   /* Flags (unused for i386). */
00083 #define AT_ENTRY    9   /* Where interpreter should transfer control. */
00084 
00085 /*
00086  * The following non-standard values are used for passing information
00087  * from John Polstra's testbed program to the dynamic linker.  These
00088  * are expected to go away soon.
00089  *
00090  * Unfortunately, these overlap the Linux non-standard values, so they
00091  * must not be used in the same context.
00092  */
00093 #define AT_BRK      10  /* Starting point for sbrk and brk. */
00094 #define AT_DEBUG    11  /* Debugging level. */
00095 
00096 /*
00097  * The following non-standard values are used in Linux ELF binaries.
00098  */
00099 #define AT_NOTELF   10  /* Program is not ELF ?? */
00100 #define AT_UID      11  /* Real uid. */
00101 #define AT_EUID     12  /* Effective uid. */
00102 #define AT_GID      13  /* Real gid. */
00103 #define AT_EGID     14  /* Effective gid. */
00104 
00105 #define AT_COUNT    15  /* Count of defined aux entry types. */
00106 
00107 /* Define "machine" characteristics */
00108 #define ELF_TARG_CLASS  ELFCLASS32
00109 #define ELF_TARG_DATA   ELFDATA2LSB
00110 #define ELF_TARG_MACH   EM_386
00111 #define ELF_TARG_VER    1
00112 
00113 #endif /* _REACTOS_ELF_MACHINE_IS_TARGET */
00114 
00115 /*
00116  * Relocation types.
00117  */
00118 
00119 #define R_386_NONE  0   /* No relocation. */
00120 #define R_386_32    1   /* Add symbol value. */
00121 #define R_386_PC32  2   /* Add PC-relative symbol value. */
00122 #define R_386_GOT32 3   /* Add PC-relative GOT offset. */
00123 #define R_386_PLT32 4   /* Add PC-relative PLT offset. */
00124 #define R_386_COPY  5   /* Copy data from shared object. */
00125 #define R_386_GLOB_DAT  6   /* Set GOT entry to data address. */
00126 #define R_386_JMP_SLOT  7   /* Set GOT entry to code address. */
00127 #define R_386_RELATIVE  8   /* Add load address of shared object. */
00128 #define R_386_GOTOFF    9   /* Add GOT-relative symbol address. */
00129 #define R_386_GOTPC 10  /* Add PC-relative GOT table address. */
00130 #define R_386_TLS_TPOFF 14  /* Negative offset in static TLS block */
00131 #define R_386_TLS_IE    15  /* Absolute address of GOT for -ve static TLS */
00132 #define R_386_TLS_GOTIE 16  /* GOT entry for negative static TLS block */
00133 #define R_386_TLS_LE    17  /* Negative offset relative to static TLS */
00134 #define R_386_TLS_GD    18  /* 32 bit offset to GOT (index,off) pair */
00135 #define R_386_TLS_LDM   19  /* 32 bit offset to GOT (index,zero) pair */
00136 #define R_386_TLS_GD_32 24  /* 32 bit offset to GOT (index,off) pair */
00137 #define R_386_TLS_GD_PUSH 25    /* pushl instruction for Sun ABI GD sequence */
00138 #define R_386_TLS_GD_CALL 26    /* call instruction for Sun ABI GD sequence */
00139 #define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */
00140 #define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */
00141 #define R_386_TLS_LDM_PUSH 29   /* pushl instruction for Sun ABI LD sequence */
00142 #define R_386_TLS_LDM_CALL 30   /* call instruction for Sun ABI LD sequence */
00143 #define R_386_TLS_LDM_POP 31    /* popl instruction for Sun ABI LD sequence */
00144 #define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */
00145 #define R_386_TLS_IE_32 33  /* 32 bit offset to GOT static TLS offset entry */
00146 #define R_386_TLS_LE_32 34  /* 32 bit offset within static TLS block */
00147 #define R_386_TLS_DTPMOD32 35   /* GOT entry containing TLS index */
00148 #define R_386_TLS_DTPOFF32 36   /* GOT entry containing TLS offset */
00149 #define R_386_TLS_TPOFF32 37    /* GOT entry of -ve static TLS offset */
00150 
00151 #define R_386_COUNT 38  /* Count of defined relocation types. */
00152 
00153 #endif /* !_MACHINE_ELF_H_ */

Generated on Sat May 26 2012 04:31:54 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.