The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/elf_common.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1998 John D. Polstra.
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  *
   14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   24  * SUCH DAMAGE.
   25  */
   26 
   27 #ifndef _SYS_ELF_COMMON_H_
   28 #define _SYS_ELF_COMMON_H_
   29 
   30 #ifndef _SYS_TYPES_H_
   31 #include <sys/types.h>
   32 #endif
   33 
   34 /*
   35  * ELF definitions that are independent of architecture or word size.
   36  */
   37 
   38 /*
   39  * Note header.  The ".note" section contains an array of notes.  Each
   40  * begins with this header, aligned to a word boundary.  Immediately
   41  * following the note header is n_namesz bytes of name, padded to the
   42  * next word boundary.  Then comes n_descsz bytes of descriptor, again
   43  * padded to a word boundary.  The values of n_namesz and n_descsz do
   44  * not include the padding.
   45  */
   46 
   47 typedef struct {
   48         u_int32_t       n_namesz;       /* Length of name. */
   49         u_int32_t       n_descsz;       /* Length of descriptor. */
   50         u_int32_t       n_type;         /* Type of this note. */
   51 } Elf_Note;
   52 
   53 /* Indexes into the e_ident array.  Keep synced with
   54    http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
   55 #define EI_MAG0         0       /* Magic number, byte 0. */
   56 #define EI_MAG1         1       /* Magic number, byte 1. */
   57 #define EI_MAG2         2       /* Magic number, byte 2. */
   58 #define EI_MAG3         3       /* Magic number, byte 3. */
   59 #define EI_CLASS        4       /* Class of machine. */
   60 #define EI_DATA         5       /* Data format. */
   61 #define EI_VERSION      6       /* ELF format version. */
   62 #define EI_OSABI        7       /* Operating system / ABI identification */
   63 #define EI_ABIVERSION   8       /* ABI version */
   64 #define EI_PAD          9       /* Start of padding (per SVR4 ABI). */
   65 #define EI_NIDENT       16      /* Size of e_ident array. */
   66 
   67 /* Values for the magic number bytes. */
   68 #define ELFMAG0         0x7f
   69 #define ELFMAG1         'E'
   70 #define ELFMAG2         'L'
   71 #define ELFMAG3         'F'
   72 #define ELFMAG          "\177ELF"       /* magic string */
   73 #define SELFMAG         4               /* magic string size */
   74 
   75 /* Values for e_ident[EI_VERSION] and e_version. */
   76 #define EV_NONE         0
   77 #define EV_CURRENT      1
   78 
   79 /* Values for e_ident[EI_CLASS]. */
   80 #define ELFCLASSNONE    0       /* Unknown class. */
   81 #define ELFCLASS32      1       /* 32-bit architecture. */
   82 #define ELFCLASS64      2       /* 64-bit architecture. */
   83 
   84 /* Values for e_ident[EI_DATA]. */
   85 #define ELFDATANONE     0       /* Unknown data format. */
   86 #define ELFDATA2LSB     1       /* 2's complement little-endian. */
   87 #define ELFDATA2MSB     2       /* 2's complement big-endian. */
   88 
   89 /* Values for e_ident[EI_OSABI]. */
   90 #define ELFOSABI_SYSV           0       /* symbol used in old spec */
   91 #define ELFOSABI_NONE           0       /* UNIX System V ABI */
   92 #define ELFOSABI_HPUX           1       /* HP-UX operating system */
   93 #define ELFOSABI_NETBSD         2       /* NetBSD */
   94 #define ELFOSABI_GNU            3       /* GNU */
   95 #define ELFOSABI_LINUX          3       /* Alias for ELFOSABI_GNU */
   96 #define ELFOSABI_SOLARIS        6       /* Solaris */
   97 #define ELFOSABI_AIX            7       /* AIX */
   98 #define ELFOSABI_IRIX           8       /* IRIX */
   99 #define ELFOSABI_FREEBSD        9       /* FreeBSD */
  100 #define ELFOSABI_TRU64          10      /* TRU64 UNIX */
  101 #define ELFOSABI_MODESTO        11      /* Novell Modesto */
  102 #define ELFOSABI_OPENBSD        12      /* OpenBSD */
  103 #define ELFOSABI_OPENVMS        13      /* OpenVMS */
  104 #define ELFOSABI_NSK            14      /* Hewlett-Packard Non-Stop Kernel */
  105 #define ELFOSABI_AROS           15      /* AROS */
  106 #define ELFOSABI_FENIXOS        16      /* FenixOS */
  107 #define ELFOSABI_C6000_ELFABI   64      /* Bare-metal TMS320C6000 */
  108 #define ELFOSABI_C6000_LINUX    65      /* Linux TMS320C6000 */
  109 #define ELFOSABI_ARM            97      /* ARM */
  110 #define ELFOSABI_STANDALONE     255     /* Standalone (embedded) application */
  111 
  112 /* e_ident */
  113 #define IS_ELF(ehdr)    ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
  114                          (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
  115                          (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
  116                          (ehdr).e_ident[EI_MAG3] == ELFMAG3)
  117 
  118 /* Values for e_type, which identifies the object file type.  */
  119 
  120 #define ET_NONE         0       /* No file type */
  121 #define ET_REL          1       /* Relocatable file */
  122 #define ET_EXEC         2       /* Executable file */
  123 #define ET_DYN          3       /* Shared object file */
  124 #define ET_CORE         4       /* Core file */
  125 #define ET_LOOS         0xFE00  /* Operating system-specific */
  126 #define ET_HIOS         0xFEFF  /* Operating system-specific */
  127 #define ET_LOPROC       0xFF00  /* Processor-specific */
  128 #define ET_HIPROC       0xFFFF  /* Processor-specific */
  129 
  130 /* Values for e_machine, which identifies the architecture.  These numbers
  131    are officially assigned by registry@sco.com.  See below for a list of
  132    ad-hoc numbers used during initial development.  */
  133 
  134 #define EM_NONE           0     /* No machine */
  135 #define EM_M32            1     /* AT&T WE 32100 */
  136 #define EM_SPARC          2     /* SUN SPARC */
  137 #define EM_386            3     /* Intel 80386 */
  138 #define EM_68K            4     /* Motorola m68k family */
  139 #define EM_88K            5     /* Motorola m88k family */
  140 #define EM_486            6     /* Intel 80486 *//* Reserved for future use */
  141 #define EM_860            7     /* Intel 80860 */
  142 #define EM_MIPS           8     /* MIPS R3000 (officially, big-endian only) */
  143 #define EM_S370           9     /* IBM System/370 */
  144 #define EM_MIPS_RS3_LE   10     /* MIPS R3000 little-endian (Oct 4 1999 Draft) Deprecated */
  145 #define EM_res011        11     /* Reserved */
  146 #define EM_res012        12     /* Reserved */
  147 #define EM_res013        13     /* Reserved */
  148 #define EM_res014        14     /* Reserved */
  149 #define EM_PARISC        15     /* HPPA */
  150 #define EM_res016        16     /* Reserved */
  151 #define EM_VPP550        17     /* Fujitsu VPP500 */
  152 #define EM_SPARC32PLUS   18     /* Sun's "v8plus" */
  153 #define EM_960           19     /* Intel 80960 */
  154 #define EM_PPC           20     /* PowerPC */
  155 #define EM_PPC64         21     /* 64-bit PowerPC */
  156 #define EM_S390          22     /* IBM S/390 */
  157 #define EM_SPU           23     /* Sony/Toshiba/IBM SPU */
  158 #define EM_res024        24     /* Reserved */
  159 #define EM_res025        25     /* Reserved */
  160 #define EM_res026        26     /* Reserved */
  161 #define EM_res027        27     /* Reserved */
  162 #define EM_res028        28     /* Reserved */
  163 #define EM_res029        29     /* Reserved */
  164 #define EM_res030        30     /* Reserved */
  165 #define EM_res031        31     /* Reserved */
  166 #define EM_res032        32     /* Reserved */
  167 #define EM_res033        33     /* Reserved */
  168 #define EM_res034        34     /* Reserved */
  169 #define EM_res035        35     /* Reserved */
  170 #define EM_V800          36     /* NEC V800 series */
  171 #define EM_FR20          37     /* Fujitsu FR20 */
  172 #define EM_RH32          38     /* TRW RH32 */
  173 #define EM_MCORE         39     /* Motorola M*Core */ /* May also be taken by Fujitsu MMA */
  174 #define EM_RCE           39     /* Old name for MCore */
  175 #define EM_ARM           40     /* ARM */
  176 #define EM_OLD_ALPHA     41     /* Digital Alpha */
  177 #define EM_SH            42     /* Renesas (formerly Hitachi) / SuperH SH */
  178 #define EM_SPARCV9       43     /* SPARC v9 64-bit */
  179 #define EM_TRICORE       44     /* Siemens Tricore embedded processor */
  180 #define EM_ARC           45     /* ARC Cores */
  181 #define EM_H8_300        46     /* Renesas (formerly Hitachi) H8/300 */
  182 #define EM_H8_300H       47     /* Renesas (formerly Hitachi) H8/300H */
  183 #define EM_H8S           48     /* Renesas (formerly Hitachi) H8S */
  184 #define EM_H8_500        49     /* Renesas (formerly Hitachi) H8/500 */
  185 #define EM_IA_64         50     /* Intel IA-64 Processor */
  186 #define EM_MIPS_X        51     /* Stanford MIPS-X */
  187 #define EM_COLDFIRE      52     /* Motorola Coldfire */
  188 #define EM_68HC12        53     /* Motorola M68HC12 */
  189 #define EM_MMA           54     /* Fujitsu Multimedia Accelerator */
  190 #define EM_PCP           55     /* Siemens PCP */
  191 #define EM_NCPU          56     /* Sony nCPU embedded RISC processor */
  192 #define EM_NDR1          57     /* Denso NDR1 microprocessor */
  193 #define EM_STARCORE      58     /* Motorola Star*Core processor */
  194 #define EM_ME16          59     /* Toyota ME16 processor */
  195 #define EM_ST100         60     /* STMicroelectronics ST100 processor */
  196 #define EM_TINYJ         61     /* Advanced Logic Corp. TinyJ embedded processor */
  197 #define EM_X86_64        62     /* Advanced Micro Devices X86-64 processor */
  198 #define EM_AMD64         62     /* Advanced Micro Devices X86-64 (compat) */
  199 #define EM_PDSP          63     /* Sony DSP Processor */
  200 #define EM_PDP10         64     /* Digital Equipment Corp. PDP-10 */
  201 #define EM_PDP11         65     /* Digital Equipment Corp. PDP-11 */
  202 #define EM_FX66          66     /* Siemens FX66 microcontroller */
  203 #define EM_ST9PLUS       67     /* STMicroelectronics ST9+ 8/16 bit microcontroller */
  204 #define EM_ST7           68     /* STMicroelectronics ST7 8-bit microcontroller */
  205 #define EM_68HC16        69     /* Motorola MC68HC16 Microcontroller */
  206 #define EM_68HC11        70     /* Motorola MC68HC11 Microcontroller */
  207 #define EM_68HC08        71     /* Motorola MC68HC08 Microcontroller */
  208 #define EM_68HC05        72     /* Motorola MC68HC05 Microcontroller */
  209 #define EM_SVX           73     /* Silicon Graphics SVx */
  210 #define EM_ST19          74     /* STMicroelectronics ST19 8-bit cpu */
  211 #define EM_VAX           75     /* Digital VAX */
  212 #define EM_CRIS          76     /* Axis Communications 32-bit embedded processor */
  213 #define EM_JAVELIN       77     /* Infineon Technologies 32-bit embedded cpu */
  214 #define EM_FIREPATH      78     /* Element 14 64-bit DSP processor */
  215 #define EM_ZSP           79     /* LSI Logic's 16-bit DSP processor */
  216 #define EM_MMIX          80     /* Donald Knuth's educational 64-bit processor */
  217 #define EM_HUANY         81     /* Harvard's machine-independent format */
  218 #define EM_PRISM         82     /* SiTera Prism */
  219 #define EM_AVR           83     /* Atmel AVR 8-bit microcontroller */
  220 #define EM_FR30          84     /* Fujitsu FR30 */
  221 #define EM_D10V          85     /* Mitsubishi D10V */
  222 #define EM_D30V          86     /* Mitsubishi D30V */
  223 #define EM_V850          87     /* Renesas V850 (formerly NEC V850) */
  224 #define EM_M32R          88     /* Renesas M32R (formerly Mitsubishi M32R) */
  225 #define EM_MN10300       89     /* Matsushita MN10300 */
  226 #define EM_MN10200       90     /* Matsushita MN10200 */
  227 #define EM_PJ            91     /* picoJava */
  228 #define EM_OPENRISC      92     /* OpenRISC 32-bit embedded processor */
  229 #define EM_ARC_A5        93     /* ARC Cores Tangent-A5 */
  230 #define EM_XTENSA        94     /* Tensilica Xtensa Architecture */
  231 #define EM_VIDEOCORE     95     /* Alphamosaic VideoCore processor */
  232 #define EM_TMM_GPP       96     /* Thompson Multimedia General Purpose Processor */
  233 #define EM_NS32K         97     /* National Semiconductor 32000 series */
  234 #define EM_TPC           98     /* Tenor Network TPC processor */
  235 #define EM_SNP1K         99     /* Trebia SNP 1000 processor */
  236 #define EM_ST200        100     /* STMicroelectronics ST200 microcontroller */
  237 #define EM_IP2K         101     /* Ubicom IP2022 micro controller */
  238 #define EM_MAX          102     /* MAX Processor */
  239 #define EM_CR           103     /* National Semiconductor CompactRISC */
  240 #define EM_F2MC16       104     /* Fujitsu F2MC16 */
  241 #define EM_MSP430       105     /* TI msp430 micro controller */
  242 #define EM_BLACKFIN     106     /* ADI Blackfin */
  243 #define EM_SE_C33       107     /* S1C33 Family of Seiko Epson processors */
  244 #define EM_SEP          108     /* Sharp embedded microprocessor */
  245 #define EM_ARCA         109     /* Arca RISC Microprocessor */
  246 #define EM_UNICORE      110     /* Microprocessor series from PKU-Unity Ltd. and MPRC of Peking University */
  247 #define EM_EXCESS       111     /* eXcess: 16/32/64-bit configurable embedded CPU */
  248 #define EM_DXP          112     /* Icera Semiconductor Inc. Deep Execution Processor */
  249 #define EM_ALTERA_NIOS2 113     /* Altera Nios II soft-core processor */
  250 #define EM_CRX          114     /* National Semiconductor CRX */
  251 #define EM_XGATE        115     /* Motorola XGATE embedded processor */
  252 #define EM_C166         116     /* Infineon C16x/XC16x processor */
  253 #define EM_M16C         117     /* Renesas M16C series microprocessors */
  254 #define EM_DSPIC30F     118     /* Microchip Technology dsPIC30F Digital Signal Controller */
  255 #define EM_CE           119     /* Freescale Communication Engine RISC core */
  256 #define EM_M32C         120     /* Renesas M32C series microprocessors */
  257 #define EM_res121       121     /* Reserved */
  258 #define EM_res122       122     /* Reserved */
  259 #define EM_res123       123     /* Reserved */
  260 #define EM_res124       124     /* Reserved */
  261 #define EM_res125       125     /* Reserved */
  262 #define EM_res126       126     /* Reserved */
  263 #define EM_res127       127     /* Reserved */
  264 #define EM_res128       128     /* Reserved */
  265 #define EM_res129       129     /* Reserved */
  266 #define EM_res130       130     /* Reserved */
  267 #define EM_TSK3000      131     /* Altium TSK3000 core */
  268 #define EM_RS08         132     /* Freescale RS08 embedded processor */
  269 #define EM_res133       133     /* Reserved */
  270 #define EM_ECOG2        134     /* Cyan Technology eCOG2 microprocessor */
  271 #define EM_SCORE        135     /* Sunplus Score */
  272 #define EM_SCORE7       135     /* Sunplus S+core7 RISC processor */
  273 #define EM_DSP24        136     /* New Japan Radio (NJR) 24-bit DSP Processor */
  274 #define EM_VIDEOCORE3   137     /* Broadcom VideoCore III processor */
  275 #define EM_LATTICEMICO32 138    /* RISC processor for Lattice FPGA architecture */
  276 #define EM_SE_C17       139     /* Seiko Epson C17 family */
  277 #define EM_TI_C6000     140     /* Texas Instruments TMS320C6000 DSP family */
  278 #define EM_TI_C2000     141     /* Texas Instruments TMS320C2000 DSP family */
  279 #define EM_TI_C5500     142     /* Texas Instruments TMS320C55x DSP family */
  280 #define EM_res143       143     /* Reserved */
  281 #define EM_res144       144     /* Reserved */
  282 #define EM_res145       145     /* Reserved */
  283 #define EM_res146       146     /* Reserved */
  284 #define EM_res147       147     /* Reserved */
  285 #define EM_res148       148     /* Reserved */
  286 #define EM_res149       149     /* Reserved */
  287 #define EM_res150       150     /* Reserved */
  288 #define EM_res151       151     /* Reserved */
  289 #define EM_res152       152     /* Reserved */
  290 #define EM_res153       153     /* Reserved */
  291 #define EM_res154       154     /* Reserved */
  292 #define EM_res155       155     /* Reserved */
  293 #define EM_res156       156     /* Reserved */
  294 #define EM_res157       157     /* Reserved */
  295 #define EM_res158       158     /* Reserved */
  296 #define EM_res159       159     /* Reserved */
  297 #define EM_MMDSP_PLUS   160     /* STMicroelectronics 64bit VLIW Data Signal Processor */
  298 #define EM_CYPRESS_M8C  161     /* Cypress M8C microprocessor */
  299 #define EM_R32C         162     /* Renesas R32C series microprocessors */
  300 #define EM_TRIMEDIA     163     /* NXP Semiconductors TriMedia architecture family */
  301 #define EM_QDSP6        164     /* QUALCOMM DSP6 Processor */
  302 #define EM_8051         165     /* Intel 8051 and variants */
  303 #define EM_STXP7X       166     /* STMicroelectronics STxP7x family */
  304 #define EM_NDS32        167     /* Andes Technology compact code size embedded RISC processor family */
  305 #define EM_ECOG1        168     /* Cyan Technology eCOG1X family */
  306 #define EM_ECOG1X       168     /* Cyan Technology eCOG1X family */
  307 #define EM_MAXQ30       169     /* Dallas Semiconductor MAXQ30 Core Micro-controllers */
  308 #define EM_XIMO16       170     /* New Japan Radio (NJR) 16-bit DSP Processor */
  309 #define EM_MANIK        171     /* M2000 Reconfigurable RISC Microprocessor */
  310 #define EM_CRAYNV2      172     /* Cray Inc. NV2 vector architecture */
  311 #define EM_RX           173     /* Renesas RX family */
  312 #define EM_METAG        174     /* Imagination Technologies META processor architecture */
  313 #define EM_MCST_ELBRUS  175     /* MCST Elbrus general purpose hardware architecture */
  314 #define EM_ECOG16       176     /* Cyan Technology eCOG16 family */
  315 #define EM_CR16         177     /* National Semiconductor CompactRISC 16-bit processor */
  316 #define EM_ETPU         178     /* Freescale Extended Time Processing Unit */
  317 #define EM_SLE9X        179     /* Infineon Technologies SLE9X core */
  318 #define EM_L1OM         180     /* Intel L1OM */
  319 #define EM_K1OM         181     /* Intel K1OM */
  320 #define EM_INTEL182     182     /* Reserved by Intel */
  321 #define EM_res183       183     /* Reserved by ARM */
  322 #define EM_res184       184     /* Reserved by ARM */
  323 #define EM_AVR32        185     /* Atmel Corporation 32-bit microprocessor family */
  324 #define EM_STM8         186     /* STMicroeletronics STM8 8-bit microcontroller */
  325 #define EM_TILE64       187     /* Tilera TILE64 multicore architecture family */
  326 #define EM_TILEPRO      188     /* Tilera TILEPro multicore architecture family */
  327 #define EM_MICROBLAZE   189     /* Xilinx MicroBlaze 32-bit RISC soft processor core */
  328 #define EM_CUDA         190     /* NVIDIA CUDA architecture */
  329 #define EM_TILEGX       191     /* Tilera TILE-Gx multicore architecture family */
  330 
  331 /* Alpha backend magic number.  Written in the absence of an ABI.  */
  332 #define EM_ALPHA                0x9026
  333 
  334 /* Special section indexes. */
  335 
  336 #define SHN_UNDEF            0          /* Undefined, missing, irrelevant. */
  337 #define SHN_LORESERVE   0xff00          /* First of reserved range. */
  338 #define SHN_LOPROC      0xff00          /* First processor-specific. */
  339 #define SHN_HIPROC      0xff1f          /* Last processor-specific. */
  340 #define SHN_LOOS        0xff20          /* First operating system-specific. */
  341 #define SHN_HIOS        0xff3f          /* Last operating system-specific. */
  342 #define SHN_ABS         0xfff1          /* Absolute values. */
  343 #define SHN_COMMON      0xfff2          /* Common data. */
  344 #define SHN_XINDEX      0xffff          /* Escape -- index stored elsewhere. */
  345 #define SHN_HIRESERVE   0xffff          /* Last of reserved range. */
  346 
  347 /* Values for program header, p_type field. */
  348 
  349 #define PT_NULL         0               /* Program header table entry unused */
  350 #define PT_LOAD         1               /* Loadable program segment */
  351 #define PT_DYNAMIC      2               /* Dynamic linking information */
  352 #define PT_INTERP       3               /* Program interpreter */
  353 #define PT_NOTE         4               /* Auxiliary information */
  354 #define PT_SHLIB        5               /* Reserved, unspecified semantics */
  355 #define PT_PHDR         6               /* Entry for header table itself */
  356 #define PT_TLS          7               /* Thread local storage segment */
  357 #define PT_LOOS         0x60000000      /* OS-specific */
  358 #define PT_HIOS         0x6fffffff      /* OS-specific */
  359 #define PT_LOPROC       0x70000000      /* Processor-specific */
  360 #define PT_HIPROC       0x7FFFFFFF      /* Processor-specific */
  361 
  362 #define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550) /* Frame unwind information */
  363 #define PT_SUNW_EH_FRAME PT_GNU_EH_FRAME      /* Solaris uses the same value */
  364 #define PT_GNU_STACK    (PT_LOOS + 0x474e551) /* Stack flags */
  365 #define PT_GNU_RELRO    (PT_LOOS + 0x474e552) /* Read-only after relocation */
  366 
  367 /* Program segment permissions, in program header p_flags field.  */
  368 
  369 #define PF_X            0x1             /* Segment is executable */
  370 #define PF_W            0x2             /* Segment is writable */
  371 #define PF_R            0x4             /* Segment is readable */
  372 #define PF_MASKOS       0x0FF00000      /* New value, Oct 4, 1999 Draft */
  373 #define PF_MASKPROC     0xF0000000      /* Processor-specific reserved bits */
  374 
  375 /* Values for section header, sh_type field.  */
  376 
  377 #define SHT_NULL                 0      /* Section header table entry unused */
  378 #define SHT_PROGBITS             1      /* Program specific (private) data */
  379 #define SHT_SYMTAB               2      /* Link editing symbol table */
  380 #define SHT_STRTAB               3      /* A string table */
  381 #define SHT_RELA                 4      /* Relocation entries with addends */
  382 #define SHT_HASH                 5      /* A symbol hash table */
  383 #define SHT_DYNAMIC              6      /* Information for dynamic linking */
  384 #define SHT_NOTE                 7      /* Information that marks file */
  385 #define SHT_NOBITS               8      /* Section occupies no space in file */
  386 #define SHT_REL                  9      /* Relocation entries, no addends */
  387 #define SHT_SHLIB               10      /* Reserved, unspecified semantics */
  388 #define SHT_DYNSYM              11      /* Dynamic linking symbol table */
  389 
  390 #define SHT_INIT_ARRAY          14      /* Array of ptrs to init functions */
  391 #define SHT_FINI_ARRAY          15      /* Array of ptrs to finish functions */
  392 #define SHT_PREINIT_ARRAY       16      /* Array of ptrs to pre-init funcs */
  393 #define SHT_GROUP               17      /* Section contains a section group */
  394 #define SHT_SYMTAB_SHNDX        18      /* Indicies for SHN_XINDEX entries */
  395 
  396 #define SHT_LOOS                0x60000000      /* First of OS specific semantics */
  397 #define SHT_HIOS                0x6fffffff      /* Last of OS specific semantics */
  398 
  399 #define SHT_GNU_INCREMENTAL_INPUTS 0x6fff4700   /* incremental build data */
  400 #define SHT_GNU_ATTRIBUTES      0x6ffffff5      /* Object attributes */
  401 #define SHT_GNU_HASH            0x6ffffff6      /* GNU style symbol hash table */
  402 #define SHT_GNU_LIBLIST         0x6ffffff7      /* List of prelink dependencies */
  403 
  404 /* The next three section types are defined by Solaris, and are named
  405    SHT_SUNW*.  We use them in GNU code, so we also define SHT_GNU*
  406    versions.  */
  407 #define SHT_SUNW_verdef         0x6ffffffd      /* Versions defined by file */
  408 #define SHT_SUNW_verneed        0x6ffffffe      /* Versions needed by file */
  409 #define SHT_SUNW_versym         0x6fffffff      /* Symbol versions */
  410 
  411 #define SHT_GNU_verdef          SHT_SUNW_verdef
  412 #define SHT_GNU_verneed         SHT_SUNW_verneed
  413 #define SHT_GNU_versym          SHT_SUNW_versym
  414 
  415 #define SHT_LOPROC      0x70000000      /* Processor-specific semantics, lo */
  416 #define SHT_HIPROC      0x7FFFFFFF      /* Processor-specific semantics, hi */
  417 #define SHT_LOUSER      0x80000000      /* Application-specific semantics */
  418 #define SHT_HIUSER      0xFFFFFFFF      /* New value, defined in Oct 4, 1999 Draft */
  419 
  420 /* Values for section header, sh_flags field.  */
  421 
  422 #define SHF_WRITE               0x1     /* Writable data during execution */
  423 #define SHF_ALLOC               0x2     /* Occupies memory during execution */
  424 #define SHF_EXECINSTR           0x4     /* Executable machine instructions */
  425 #define SHF_MERGE               0x10    /* Data in this section can be merged */
  426 #define SHF_STRINGS             0x20    /* Contains null terminated character strings */
  427 #define SHF_INFO_LINK           0x40    /* sh_info holds section header table index */
  428 #define SHF_LINK_ORDER          0x80    /* Preserve section ordering when linking */
  429 #define SHF_OS_NONCONFORMING    0x100   /* OS specific processing required */
  430 #define SHF_GROUP               0x200   /* Member of a section group */
  431 #define SHF_TLS                 0x400   /* Thread local storage section */
  432 
  433 #define SHF_MASKOS      0x0FF00000      /* New value, Oct 4, 1999 Draft */
  434 #define SHF_MASKPROC    0xF0000000      /* Processor-specific semantics */
  435 
  436 /* Values of note segment descriptor types for core files. */
  437 
  438 #define NT_PRSTATUS     1               /* Contains copy of prstatus struct */
  439 #define NT_FPREGSET     2               /* Contains copy of fpregset struct */
  440 #define NT_PRPSINFO     3               /* Contains copy of prpsinfo struct */
  441 #define NT_TASKSTRUCT   4               /* Contains copy of task struct */
  442 #define NT_AUXV         6               /* Contains copy of Elfxx_auxv_t */
  443 
  444 #define STN_UNDEF       0               /* Undefined symbol index */
  445 
  446 #define STB_LOCAL       0               /* Symbol not visible outside obj */
  447 #define STB_GLOBAL      1               /* Symbol visible outside obj */
  448 #define STB_WEAK        2               /* Like globals, lower precedence */
  449 #define STB_LOOS        10              /* OS-specific semantics */
  450 #define STB_GNU_UNIQUE  10              /* Symbol is unique in namespace */
  451 #define STB_HIOS        12              /* OS-specific semantics */
  452 #define STB_LOPROC      13              /* Processor-specific semantics */
  453 #define STB_HIPROC      15              /* Processor-specific semantics */
  454 
  455 #define STT_NOTYPE      0               /* Symbol type is unspecified */
  456 #define STT_OBJECT      1               /* Symbol is a data object */
  457 #define STT_FUNC        2               /* Symbol is a code object */
  458 #define STT_SECTION     3               /* Symbol associated with a section */
  459 #define STT_FILE        4               /* Symbol gives a file name */
  460 #define STT_COMMON      5               /* An uninitialised common block */
  461 #define STT_TLS         6               /* Thread local data object */
  462 #define STT_RELC        8               /* Complex relocation expression */
  463 #define STT_SRELC       9               /* Signed Complex relocation expression */
  464 #define STT_LOOS        10              /* OS-specific semantics */
  465 #define STT_GNU_IFUNC   10              /* Symbol is an indirect code object */
  466 #define STT_HIOS        12              /* OS-specific semantics */
  467 #define STT_LOPROC      13              /* Processor-specific semantics */
  468 #define STT_HIPROC      15              /* Processor-specific semantics */
  469 
  470 /* The following constants control how a symbol may be accessed once it has
  471    become part of an executable or shared library.  */
  472 
  473 #define STV_DEFAULT     0               /* Visibility is specified by binding type */
  474 #define STV_INTERNAL    1               /* OS specific version of STV_HIDDEN */
  475 #define STV_HIDDEN      2               /* Can only be seen inside currect component */
  476 #define STV_PROTECTED   3               /* Treat as STB_LOCAL inside current component */
  477 
  478 /* Dynamic section tags.  */
  479 
  480 #define DT_NULL         0       /* Terminating entry. */
  481 #define DT_NEEDED       1       /* String table offset of a needed shared
  482                                    library. */
  483 #define DT_PLTRELSZ     2       /* Total size in bytes of PLT relocations. */
  484 #define DT_PLTGOT       3       /* Processor-dependent address. */
  485 #define DT_HASH         4       /* Address of symbol hash table. */
  486 #define DT_STRTAB       5       /* Address of string table. */
  487 #define DT_SYMTAB       6       /* Address of symbol table. */
  488 #define DT_RELA         7       /* Address of ElfNN_Rela relocations. */
  489 #define DT_RELASZ       8       /* Total size of ElfNN_Rela relocations. */
  490 #define DT_RELAENT      9       /* Size of each ElfNN_Rela relocation entry. */
  491 #define DT_STRSZ        10      /* Size of string table. */
  492 #define DT_SYMENT       11      /* Size of each symbol table entry. */
  493 #define DT_INIT         12      /* Address of initialization function. */
  494 #define DT_FINI         13      /* Address of finalization function. */
  495 #define DT_SONAME       14      /* String table offset of shared object
  496                                    name. */
  497 #define DT_RPATH        15      /* String table offset of library path. [sup] */
  498 #define DT_SYMBOLIC     16      /* Indicates "symbolic" linking. [sup] */
  499 #define DT_REL          17      /* Address of ElfNN_Rel relocations. */
  500 #define DT_RELSZ        18      /* Total size of ElfNN_Rel relocations. */
  501 #define DT_RELENT       19      /* Size of each ElfNN_Rel relocation. */
  502 #define DT_PLTREL       20      /* Type of relocation used for PLT. */
  503 #define DT_DEBUG        21      /* Reserved (not used). */
  504 #define DT_TEXTREL      22      /* Indicates there may be relocations in
  505                                    non-writable segments. [sup] */
  506 #define DT_JMPREL       23      /* Address of PLT relocations. */
  507 #define DT_BIND_NOW     24      /* [sup] */
  508 #define DT_INIT_ARRAY   25      /* Address of the array of pointers to
  509                                    initialization functions */
  510 #define DT_FINI_ARRAY   26      /* Address of the array of pointers to
  511                                    termination functions */
  512 #define DT_INIT_ARRAYSZ 27      /* Size in bytes of the array of
  513                                    initialization functions. */
  514 #define DT_FINI_ARRAYSZ 28      /* Size in bytes of the array of
  515                                    terminationfunctions. */
  516 #define DT_RUNPATH      29      /* String table offset of a null-terminated
  517                                    library search path string. */
  518 #define DT_FLAGS        30      /* Object specific flag values. */
  519 #define DT_ENCODING     32      /* Values greater than or equal to DT_ENCODING
  520                                    and less than DT_LOOS follow the rules for
  521                                    the interpretation of the d_un union
  522                                    as follows: even == 'd_ptr', odd == 'd_val'
  523                                    or none */
  524 #define DT_PREINIT_ARRAY 32     /* Address of the array of pointers to
  525                                    pre-initialization functions. */
  526 #define DT_PREINIT_ARRAYSZ 33   /* Size in bytes of the array of
  527                                    pre-initialization functions. */
  528 
  529 #define DT_LOOS         0x6000000d      /* First OS-specific */
  530 #define DT_HIOS         0x6fff0000      /* Last OS-specific */
  531 
  532 /* The next 2 dynamic tag ranges, integer value range (DT_VALRNGLO to
  533    DT_VALRNGHI) and virtual address range (DT_ADDRRNGLO to DT_ADDRRNGHI),
  534    are used on Solaris.  We support them everywhere.  Note these values
  535    lie outside of the (new) range for OS specific values.  This is a
  536    deliberate special case and we maintain it for backwards compatability.
  537  */
  538 #define DT_VALRNGLO             0x6ffffd00
  539 #define DT_GNU_PRELINKED        0x6ffffdf5
  540 #define DT_GNU_CONFLICTSZ       0x6ffffdf6
  541 #define DT_GNU_LIBLISTSZ        0x6ffffdf7
  542 #define DT_CHECKSUM     0x6ffffdf8      /* elf checksum */
  543 #define DT_PLTPADSZ     0x6ffffdf9      /* pltpadding size */
  544 #define DT_MOVEENT      0x6ffffdfa      /* move table entry size */
  545 #define DT_MOVESZ       0x6ffffdfb      /* move table size */
  546 #define DT_FEATURE      0x6ffffdfc      /* feature holder */
  547 #define DT_POSFLAG_1    0x6ffffdfd      /* flags for DT_* entries, effecting */
  548                                         /*   the following DT_* entry. */
  549                                         /*   See DF_P1_* definitions */
  550 #define DT_SYMINSZ      0x6ffffdfe      /* syminfo table size (in bytes) */
  551 #define DT_SYMINENT     0x6ffffdff      /* syminfo entry size (in bytes) */
  552 #define DT_VALRNGHI     0x6ffffdff
  553 
  554 #define DT_ADDRRNGLO    0x6ffffe00
  555 #define DT_GNU_HASH     0x6ffffef5      /* GNU-style hash table */
  556 #define DT_TLSDESC_PLT  0x6ffffef6
  557 #define DT_TLSDESC_GOT  0x6ffffef7
  558 #define DT_GNU_CONFLICT 0x6ffffef8
  559 #define DT_GNU_LIBLIST  0x6ffffef9
  560 #define DT_CONFIG       0x6ffffefa      /* configuration information */
  561 #define DT_DEPAUDIT     0x6ffffefb      /* dependency auditing */
  562 #define DT_AUDIT        0x6ffffefc      /* object auditing */
  563 #define DT_PLTPAD       0x6ffffefd      /* pltpadding (sparcv9) */
  564 #define DT_MOVETAB      0x6ffffefe      /* move table */
  565 #define DT_SYMINFO      0x6ffffeff      /* syminfo table */
  566 #define DT_ADDRRNGHI    0x6ffffeff
  567 
  568 #define DT_RELACOUNT    0x6ffffff9      /* number of RELATIVE relocations */
  569 #define DT_RELCOUNT     0x6ffffffa      /* number of RELATIVE relocations */
  570 #define DT_FLAGS_1      0x6ffffffb      /* state flags - see DF_1_* defs */
  571 #define DT_VERDEF       0x6ffffffc      /* Address of verdef section. */
  572 #define DT_VERDEFNUM    0x6ffffffd      /* Number of elems in verdef section */
  573 #define DT_VERNEED      0x6ffffffe      /* Address of verneed section. */
  574 #define DT_VERNEEDNUM   0x6fffffff      /* Number of elems in verneed section */
  575 
  576 /* This tag is a GNU extension to the Solaris version scheme.  */
  577 #define DT_VERSYM       0x6ffffff0
  578 
  579 #define DT_LOPROC       0x70000000      /* First processor-specific type. */
  580 #define DT_HIPROC       0x7fffffff      /* Last processor-specific type. */
  581 
  582 /* These section tags are used on Solaris.  We support them
  583    everywhere, and hope they do not conflict.  */
  584 
  585 #define DT_AUXILIARY    0x7ffffffd      /* shared library auxiliary name */
  586 #define DT_USED         0x7ffffffe      /* ignored - same as needed */
  587 #define DT_FILTER       0x7fffffff      /* shared library filter name */
  588 
  589 
  590 /* Values used in DT_FEATURE .dynamic entry.  */
  591 #define DTF_1_PARINIT   0x00000001
  592 /* From
  593 
  594    http://docs.sun.com:80/ab2/coll.45.13/LLM/@Ab2PageView/21165?Ab2Lang=C&Ab2Enc=iso-8859-1
  595 
  596    DTF_1_CONFEXP is the same as DTF_1_PARINIT. It is a typo. The value
  597    defined here is the same as the one in <sys/link.h> on Solaris 8.  */
  598 #define DTF_1_CONFEXP   0x00000002
  599 
  600 /* Flag values used in the DT_POSFLAG_1 .dynamic entry.  */
  601 #define DF_P1_LAZYLOAD  0x00000001
  602 #define DF_P1_GROUPPERM 0x00000002
  603 
  604 /* Flag value in in the DT_FLAGS_1 .dynamic entry.  */
  605 #define DF_1_NOW        0x00000001
  606 #define DF_1_BIND_NOW   0x00000001      /* Same as DF_BIND_NOW */
  607 #define DF_1_GLOBAL     0x00000002      /* Set the RTLD_GLOBAL for object */
  608 #define DF_1_GROUP      0x00000004
  609 #define DF_1_NODELETE   0x00000008      /* Set the RTLD_NODELETE for object */
  610 #define DF_1_LOADFLTR   0x00000010      /* Immediate loading of filtees */
  611 #define DF_1_INITFIRST  0x00000020
  612 #define DF_1_NOOPEN     0x00000040      /* Do not allow loading on dlopen() */
  613 #define DF_1_ORIGIN     0x00000080      /* Process $ORIGIN */
  614 #define DF_1_DIRECT     0x00000100
  615 #define DF_1_TRANS      0x00000200
  616 #define DF_1_INTERPOSE  0x00000400
  617 #define DF_1_NODEFLIB   0x00000800
  618 #define DF_1_NODUMP     0x00001000
  619 #define DF_1_CONLFAT    0x00002000
  620 
  621 /* Flag values for the DT_FLAGS entry. */
  622 #define DF_ORIGIN       0x1     /* Indicates that the object being loaded may
  623                                    make reference to the $ORIGIN substitution
  624                                    string */
  625 #define DF_SYMBOLIC     0x2     /* Indicates "symbolic" linking. */
  626 #define DF_TEXTREL      0x4     /* Indicates there may be relocations in
  627                                    non-writable segments. */
  628 #define DF_BIND_NOW     0x8     /* Indicates that the dynamic linker should
  629                                    process all relocations for the object
  630                                    containing this entry before transferring
  631                                    control to the program. */
  632 #define DF_STATIC_TLS   0x10    /* Indicates that the shared object or
  633                                    executable contains code using a static
  634                                    thread-local storage scheme. */
  635 
  636 /* These constants are used for the version number of a Elf32_Verdef
  637    structure.  */
  638 
  639 #define VER_DEF_NONE            0
  640 #define VER_DEF_CURRENT         1
  641 #define VER_DEF_IDX(x)          VER_NDX(x)
  642 
  643 /* These constants appear in the vd_flags field of a Elf32_Verdef
  644    structure.
  645 
  646    Cf. the Solaris Linker and Libraries Guide, Ch. 7, Object File Format,
  647    Versioning Sections, for a description:
  648 
  649    http://docs.sun.com/app/docs/doc/819-0690/chapter6-93046?l=en&a=view  */
  650 
  651 #define VER_FLG_BASE            0x1
  652 #define VER_FLG_WEAK            0x2
  653 #define VER_FLG_INFO            0x4
  654 
  655 /* These special constants can be found in an Elf32_Versym field.  */
  656 
  657 #define VER_NDX_LOCAL           0
  658 #define VER_NDX_GLOBAL          1
  659 #define VER_NDX_GIVEN           2
  660 #define VER_NDX_HIDDEN          (1u << 15)
  661 #define VER_NDX(x)              ((x) & ~(1u << 15))
  662 /* These constants are used for the version number of a Elf32_Verneed
  663    structure.  */
  664 
  665 #define VER_NEED_NONE           0
  666 #define VER_NEED_CURRENT        1
  667 #define VER_NEED_WEAK           (1u << 15)
  668 #define VER_NEED_HIDDEN         VER_NDX_HIDDEN
  669 #define VER_NEED_IDX(x)         VER_NDX(x)
  670 
  671 /* This flag appears in a Versym structure.  It means that the symbol
  672    is hidden, and is only visible with an explicit version number.
  673    This is a GNU extension.  */
  674 
  675 #define VERSYM_HIDDEN           0x8000
  676 
  677 /* This is the mask for the rest of the Versym information.  */
  678 
  679 #define VERSYM_VERSION          0x7fff
  680 
  681 /* This is a special token which appears as part of a symbol name.  It
  682    indictes that the rest of the name is actually the name of a
  683    version node, and is not part of the actual name.  This is a GNU
  684    extension.  For example, the symbol name `stat@ver2' is taken to
  685    mean the symbol `stat' in version `ver2'.  */
  686 
  687 #define ELF_VER_CHR             '@'
  688 
  689 /* Possible values for si_boundto.  */
  690 
  691 #define SYMINFO_BT_SELF         0xffff  /* Symbol bound to self */
  692 #define SYMINFO_BT_PARENT       0xfffe  /* Symbol bound to parent */
  693 #define SYMINFO_BT_LOWRESERVE   0xff00  /* Beginning of reserved entries */
  694 
  695 /* Possible bitmasks for si_flags.  */
  696 
  697 #define SYMINFO_FLG_DIRECT      0x0001  /* Direct bound symbol */
  698 #define SYMINFO_FLG_PASSTHRU    0x0002  /* Pass-thru symbol for translator */
  699 #define SYMINFO_FLG_COPY        0x0004  /* Symbol is a copy-reloc */
  700 #define SYMINFO_FLG_LAZYLOAD    0x0008  /* Symbol bound to object to be lazy loaded */
  701 
  702 /* Syminfo version values.  */
  703 
  704 #define SYMINFO_NONE            0
  705 #define SYMINFO_CURRENT         1
  706 #define SYMINFO_NUM             2
  707 
  708 /* Section Group Flags.  */
  709 
  710 #define GRP_COMDAT              0x1     /* A COMDAT group */
  711 
  712 #endif /* !_SYS_ELF_COMMON_H_ */

Cache object: e7f08b4b201c0968c8485c86e8b449ce


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.