ELF.h revision 766f25306af343fb2784350cb4d8cd9ca180f0d3
1551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer//===-- llvm/Support/ELF.h - ELF constants and data structures --*- C++ -*-===//
263b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman//
36c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//                     The LLVM Compiler Infrastructure
46c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//
57ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// This file is distributed under the University of Illinois Open Source
67ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// License. See LICENSE.TXT for details.
763b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman//
86c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//===----------------------------------------------------------------------===//
96c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//
106c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// This header contains common, non-processor-specific data structures and
116c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// constants for the ELF file format.
1263b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman//
139a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// The details of the ELF32 bits in this file are largely based on the Tool
149a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Interface Standard (TIS) Executable and Linking Format (ELF) Specification
159a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Version 1.2, May 1995. The ELF64 stuff is based on ELF-64 Object File Format
169a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Version 1.5, Draft 2, May 1998 as well as OpenBSD header files.
176c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//
186c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke//===----------------------------------------------------------------------===//
196c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
20551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer#ifndef LLVM_SUPPORT_ELF_H
21551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer#define LLVM_SUPPORT_ELF_H
22551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer
231f6efa3996dd1929fbc129203ce5009b620e6969Michael J. Spencer#include "llvm/Support/DataTypes.h"
246c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke#include <cstring>
256c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekenamespace llvm {
276c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
286c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekenamespace ELF {
296c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
306c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Addr; // Program address
316c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Off;  // File offset
32c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef uint16_t Elf32_Half;
336c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Word;
34c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int32_t  Elf32_Sword;
356c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
36620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Addr;
37620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Off;
38c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef uint16_t Elf64_Half;
39620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint32_t Elf64_Word;
40c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int32_t  Elf64_Sword;
41620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Xword;
42c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int64_t  Elf64_Sxword;
43620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke
446c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file magic string.
45757c1f9d87b516a1e3bc4cd678245b207ae9c559Brian Gaekestatic const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
466c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
479a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// e_ident size and indices.
489a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonenum {
499a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG0       = 0,          // File identification index.
509a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG1       = 1,          // File identification index.
519a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG2       = 2,          // File identification index.
529a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG3       = 3,          // File identification index.
539a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_CLASS      = 4,          // File class.
549a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_DATA       = 5,          // Data encoding.
559a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_VERSION    = 6,          // File version.
569a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_OSABI      = 7,          // OS/ABI identification.
579a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_ABIVERSION = 8,          // ABI version.
589a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_PAD        = 9,          // Start of padding bytes.
599a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_NIDENT     = 16          // Number of bytes in e_ident.
609a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
619a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
626c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Ehdr {
639a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes
646c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_type;      // Type of file (see ET_* below)
656c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_machine;   // Required architecture for this file (see EM_*)
666c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    e_version;   // Must be equal to 1
676c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr    e_entry;     // Address to jump to in order to start program
686c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off     e_phoff;     // Program header table's file offset, in bytes
696c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off     e_shoff;     // Section header table's file offset, in bytes
706c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    e_flags;     // Processor-specific flags
716c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_ehsize;    // Size of ELF header, in bytes
726c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_phentsize; // Size of an entry in the program header table
736c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_phnum;     // Number of entries in the program header table
746c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shentsize; // Size of an entry in the section header table
756c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shnum;     // Number of entries in the section header table
766c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shstrndx;  // Sect hdr table index of sect name string table
77fe4591bfc2b147c10d6a7b1a5af56454fb78daceStephen Wilson  bool checkMagic() const {
78314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
796c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  }
809a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }
819a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }
826c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
836c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
84620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke// 64-bit ELF header. Fields are the same as for ELF32, but with different
85620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke// types (see above).
86e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaekestruct Elf64_Ehdr {
879a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char e_ident[EI_NIDENT];
88c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_type;
89c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_machine;
90c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word    e_version;
91620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Addr    e_entry;
92620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Off     e_phoff;
93620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Off     e_shoff;
94c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word    e_flags;
95c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_ehsize;
96c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_phentsize;
97c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_phnum;
98c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shentsize;
99c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shnum;
100c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shstrndx;
1019a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  bool checkMagic() const {
1029a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
1039a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  }
1049a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }
1059a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }
106e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaeke};
107620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke
1086c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// File types
1096c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
1106c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_NONE   = 0,      // No file type
1116c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_REL    = 1,      // Relocatable file
1126c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_EXEC   = 2,      // Executable file
1136c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_DYN    = 3,      // Shared object file
1146c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_CORE   = 4,      // Core file
1156c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_LOPROC = 0xff00, // Beginning of processor-specific codes
1166c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_HIPROC = 0xffff  // Processor-specific
1176c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
1186c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
1195af8f421b6412e52530608097e39d2602195629fDan Gohman// Versioning
1205af8f421b6412e52530608097e39d2602195629fDan Gohmanenum {
1215af8f421b6412e52530608097e39d2602195629fDan Gohman  EV_NONE = 0,
1225af8f421b6412e52530608097e39d2602195629fDan Gohman  EV_CURRENT = 1
1235af8f421b6412e52530608097e39d2602195629fDan Gohman};
1245af8f421b6412e52530608097e39d2602195629fDan Gohman
1256c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Machine architectures
1266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
127fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NONE          = 0, // No machine
128fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32           = 1, // AT&T WE 32100
129fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARC         = 2, // SPARC
130fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_386           = 3, // Intel 386
131fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68K           = 4, // Motorola 68000
132fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_88K           = 5, // Motorola 88000
133fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_486           = 6, // Intel 486 (deprecated)
134fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_860           = 7, // Intel 80860
135fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS          = 8, // MIPS R3000
136fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_S370          = 9, // IBM System/370
137fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS_RS3_LE   = 10, // MIPS RS3000 Little-endian
138fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PARISC        = 15, // Hewlett-Packard PA-RISC
139fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VPP500        = 17, // Fujitsu VPP500
140fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARC32PLUS   = 18, // Enhanced instruction set SPARC
141fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_960           = 19, // Intel 80960
142fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PPC           = 20, // PowerPC
143fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PPC64         = 21, // PowerPC64
144fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_S390          = 22, // IBM System/390
145fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPU           = 23, // IBM SPU/SPC
146fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_V800          = 36, // NEC V800
147fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FR20          = 37, // Fujitsu FR20
148fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RH32          = 38, // TRW RH-32
149fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RCE           = 39, // Motorola RCE
150fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARM           = 40, // ARM
151fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ALPHA         = 41, // DEC Alpha
152fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SH            = 42, // Hitachi SH
153fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARCV9       = 43, // SPARC V9
154fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TRICORE       = 44, // Siemens TriCore
155fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC           = 45, // Argonaut RISC Core
156fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_300        = 46, // Hitachi H8/300
157fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_300H       = 47, // Hitachi H8/300H
158fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8S           = 48, // Hitachi H8S
159fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_500        = 49, // Hitachi H8/500
160fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_IA_64         = 50, // Intel IA-64 processor architecture
161fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS_X        = 51, // Stanford MIPS-X
162fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COLDFIRE      = 52, // Motorola ColdFire
163fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC12        = 53, // Motorola M68HC12
164fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMA           = 54, // Fujitsu MMA Multimedia Accelerator
165fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PCP           = 55, // Siemens PCP
166fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NCPU          = 56, // Sony nCPU embedded RISC processor
167fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NDR1          = 57, // Denso NDR1 microprocessor
168fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STARCORE      = 58, // Motorola Star*Core processor
169fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ME16          = 59, // Toyota ME16 processor
170fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST100         = 60, // STMicroelectronics ST100 processor
171fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TINYJ         = 61, // Advanced Logic Corp. TinyJ embedded processor family
172fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_X86_64        = 62, // AMD x86-64 architecture
173fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDSP          = 63, // Sony DSP Processor
174fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDP10         = 64, // Digital Equipment Corp. PDP-10
175fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDP11         = 65, // Digital Equipment Corp. PDP-11
176fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FX66          = 66, // Siemens FX66 microcontroller
177fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST9PLUS       = 67, // STMicroelectronics ST9+ 8/16 bit microcontroller
178fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST7           = 68, // STMicroelectronics ST7 8-bit microcontroller
179fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC16        = 69, // Motorola MC68HC16 Microcontroller
180fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC11        = 70, // Motorola MC68HC11 Microcontroller
181fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC08        = 71, // Motorola MC68HC08 Microcontroller
182fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC05        = 72, // Motorola MC68HC05 Microcontroller
183fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SVX           = 73, // Silicon Graphics SVx
184fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST19          = 74, // STMicroelectronics ST19 8-bit microcontroller
185fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VAX           = 75, // Digital VAX
186fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRIS          = 76, // Axis Communications 32-bit embedded processor
187fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_JAVELIN       = 77, // Infineon Technologies 32-bit embedded processor
188fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FIREPATH      = 78, // Element 14 64-bit DSP Processor
189fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ZSP           = 79, // LSI Logic 16-bit DSP Processor
190fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMIX          = 80, // Donald Knuth's educational 64-bit processor
191fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_HUANY         = 81, // Harvard University machine-independent object files
192fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PRISM         = 82, // SiTera Prism
193fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_AVR           = 83, // Atmel AVR 8-bit microcontroller
194fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FR30          = 84, // Fujitsu FR30
195fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_D10V          = 85, // Mitsubishi D10V
196fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_D30V          = 86, // Mitsubishi D30V
197fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_V850          = 87, // NEC v850
198fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32R          = 88, // Mitsubishi M32R
199fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MN10300       = 89, // Matsushita MN10300
200fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MN10200       = 90, // Matsushita MN10200
201fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PJ            = 91, // picoJava
202fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_OPENRISC      = 92, // OpenRISC 32-bit embedded processor
203fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC_COMPACT   = 93, // ARC International ARCompact processor (old
204fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                         // spelling/synonym: EM_ARC_A5)
205fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XTENSA        = 94, // Tensilica Xtensa Architecture
206fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE     = 95, // Alphamosaic VideoCore processor
207fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TMM_GPP       = 96, // Thompson Multimedia General Purpose Processor
208fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NS32K         = 97, // National Semiconductor 32000 series
209fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TPC           = 98, // Tenor Network TPC processor
210fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SNP1K         = 99, // Trebia SNP 1000 processor
211fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST200         = 100, // STMicroelectronics (www.st.com) ST200
212fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_IP2K          = 101, // Ubicom IP2xxx microcontroller family
213fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MAX           = 102, // MAX Processor
214fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CR            = 103, // National Semiconductor CompactRISC microprocessor
215fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_F2MC16        = 104, // Fujitsu F2MC16
216fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MSP430        = 105, // Texas Instruments embedded microcontroller msp430
217fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_BLACKFIN      = 106, // Analog Devices Blackfin (DSP) processor
218fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SE_C33        = 107, // S1C33 Family of Seiko Epson processors
219fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SEP           = 108, // Sharp embedded microprocessor
220fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARCA          = 109, // Arca RISC Microprocessor
221fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_UNICORE       = 110, // Microprocessor series from PKU-Unity Ltd. and MPRC
222fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // of Peking University
223fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_EXCESS        = 111, // eXcess: 16/32/64-bit configurable embedded CPU
224fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DXP           = 112, // Icera Semiconductor Inc. Deep Execution Processor
225fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ALTERA_NIOS2  = 113, // Altera Nios II soft-core processor
226fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRX           = 114, // National Semiconductor CompactRISC CRX
227fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XGATE         = 115, // Motorola XGATE embedded processor
228fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_C166          = 116, // Infineon C16x/XC16x processor
229fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M16C          = 117, // Renesas M16C series microprocessors
230fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DSPIC30F      = 118, // Microchip Technology dsPIC30F Digital Signal
231fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // Controller
232fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CE            = 119, // Freescale Communication Engine RISC core
233fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32C          = 120, // Renesas M32C series microprocessors
234fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TSK3000       = 131, // Altium TSK3000 core
235fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RS08          = 132, // Freescale RS08 embedded processor
236fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SHARC         = 133, // Analog Devices SHARC family of 32-bit DSP
237fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // processors
238fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG2         = 134, // Cyan Technology eCOG2 microprocessor
239fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SCORE7        = 135, // Sunplus S+core7 RISC processor
240fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DSP24         = 136, // New Japan Radio (NJR) 24-bit DSP Processor
241fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE3    = 137, // Broadcom VideoCore III processor
242fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_LATTICEMICO32 = 138, // RISC processor for Lattice FPGA architecture
243fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SE_C17        = 139, // Seiko Epson C17 family
244fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C6000      = 140, // The Texas Instruments TMS320C6000 DSP family
245fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C2000      = 141, // The Texas Instruments TMS320C2000 DSP family
246fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C5500      = 142, // The Texas Instruments TMS320C55x DSP family
247fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMDSP_PLUS    = 160, // STMicroelectronics 64bit VLIW Data Signal Processor
248fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CYPRESS_M8C   = 161, // Cypress M8C microprocessor
249fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_R32C          = 162, // Renesas R32C series microprocessors
250fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TRIMEDIA      = 163, // NXP Semiconductors TriMedia architecture family
25168ef0382e4efe4a4c06e47a53a275b873ba0cff4Evandro Menezes  EM_HEXAGON       = 164, // Qualcomm Hexagon processor
252fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_8051          = 165, // Intel 8051 and variants
253fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STXP7X        = 166, // STMicroelectronics STxP7x family of configurable
254fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // and extensible RISC processors
255fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NDS32         = 167, // Andes Technology compact code size embedded RISC
256fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // processor family
257fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG1         = 168, // Cyan Technology eCOG1X family
258fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG1X        = 168, // Cyan Technology eCOG1X family
259fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MAXQ30        = 169, // Dallas Semiconductor MAXQ30 Core Micro-controllers
260fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XIMO16        = 170, // New Japan Radio (NJR) 16-bit DSP Processor
261fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MANIK         = 171, // M2000 Reconfigurable RISC Microprocessor
262fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRAYNV2       = 172, // Cray Inc. NV2 vector architecture
263fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RX            = 173, // Renesas RX family
264fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_METAG         = 174, // Imagination Technologies META processor
265fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // architecture
266fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MCST_ELBRUS   = 175, // MCST Elbrus general purpose hardware architecture
267fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG16        = 176, // Cyan Technology eCOG16 family
268fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CR16          = 177, // National Semiconductor CompactRISC CR16 16-bit
269fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // microprocessor
270fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ETPU          = 178, // Freescale Extended Time Processing Unit
271fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SLE9X         = 179, // Infineon Technologies SLE9X core
272fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_L10M          = 180, // Intel L10M
273fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_K10M          = 181, // Intel K10M
27472062f5744557e270a38192554c3126ea5f97434Tim Northover  EM_AARCH64       = 183, // ARM AArch64
275fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_AVR32         = 185, // Atmel Corporation 32-bit microprocessor family
276fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STM8          = 186, // STMicroeletronics STM8 8-bit microcontroller
277fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILE64        = 187, // Tilera TILE64 multicore architecture family
278fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILEPRO       = 188, // Tilera TILEPro multicore architecture family
279fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CUDA          = 190, // NVIDIA CUDA architecture
280fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILEGX        = 191, // Tilera TILE-Gx multicore architecture family
281fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CLOUDSHIELD   = 192, // CloudShield architecture family
282fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COREA_1ST     = 193, // KIPO-KAIST Core-A 1st generation processor family
283fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COREA_2ND     = 194, // KIPO-KAIST Core-A 2nd generation processor family
284fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC_COMPACT2  = 195, // Synopsys ARCompact V2
285fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_OPEN8         = 196, // Open8 8-bit RISC soft processor core
286fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RL78          = 197, // Renesas RL78 family
287fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE5    = 198, // Broadcom VideoCore V processor
288fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_78KOR         = 199, // Renesas 78KOR family
2896fccaafd8be0eb7619b5a210387b0d1254ef4174Rafael Espindola  EM_56800EX       = 200  // Freescale 56800EX Digital Signal Controller (DSC)
2906c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
2916c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
2926c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file classes.
2936c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
294b84551a14f1c96942eb82408652e633543b0961eMichael J. Spencer  ELFCLASSNONE = 0,
2956c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFCLASS32 = 1, // 32-bit object file
2966c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFCLASS64 = 2  // 64-bit object file
2976c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
2986c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
2996c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file byte orderings.
3006c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
3019a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  ELFDATANONE = 0, // Invalid data encoding.
3026c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFDATA2LSB = 1, // Little-endian object file
3036c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFDATA2MSB = 2  // Big-endian object file
3046c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
3056c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
306e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming// OS ABI identification.
3075af8f421b6412e52530608097e39d2602195629fDan Gohmanenum {
308e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NONE = 0,          // UNIX System V ABI
309e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_HPUX = 1,          // HP-UX operating system
310e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NETBSD = 2,        // NetBSD
311d56d756611173394e4ec937601ab825280fc2577Sean Silva  ELFOSABI_GNU = 3,           // GNU/Linux
312d56d756611173394e4ec937601ab825280fc2577Sean Silva  ELFOSABI_LINUX = 3,         // Historical alias for ELFOSABI_GNU.
313e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_HURD = 4,          // GNU/Hurd
314e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_SOLARIS = 6,       // Solaris
315e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_AIX = 7,           // AIX
316e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_IRIX = 8,          // IRIX
317e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_FREEBSD = 9,       // FreeBSD
318e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_TRU64 = 10,        // TRU64 UNIX
319e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_MODESTO = 11,      // Novell Modesto
320e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_OPENBSD = 12,      // OpenBSD
321e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_OPENVMS = 13,      // OpenVMS
322e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NSK = 14,          // Hewlett-Packard Non-Stop Kernel
323e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_AROS = 15,         // AROS
324e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_FENIXOS = 16,      // FenixOS
325e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000
326e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_C6000_LINUX = 65,  // Linux TMS320C6000
327e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_ARM = 97,          // ARM
328e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_STANDALONE = 255   // Standalone (embedded) application
3295af8f421b6412e52530608097e39d2602195629fDan Gohman};
3305af8f421b6412e52530608097e39d2602195629fDan Gohman
331004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming// X86_64 relocations.
332004c82ad7c0d2da761726f063373c28ffd18e66dMatt Flemingenum {
333004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_NONE       = 0,
334004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_64         = 1,
335004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC32       = 2,
336004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOT32      = 3,
337004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PLT32      = 4,
338004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_COPY       = 5,
339004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GLOB_DAT   = 6,
340004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_JUMP_SLOT  = 7,
341004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_RELATIVE   = 8,
342004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPCREL   = 9,
343004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_32         = 10,
344004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_32S        = 11,
345004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_16         = 12,
346004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC16       = 13,
347004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_8          = 14,
348004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC8        = 15,
349004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPMOD64   = 16,
350004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPOFF64   = 17,
351004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TPOFF64    = 18,
352004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSGD      = 19,
353004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSLD      = 20,
354004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPOFF32   = 21,
355004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTTPOFF   = 22,
356004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TPOFF32    = 23,
357004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC64       = 24,
358004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTOFF64   = 25,
359004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPC32    = 26,
360fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOT64      = 27,
361fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPCREL64 = 28,
362fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPC64    = 29,
363fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPLT64   = 30,
364fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_PLTOFF64   = 31,
365004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_SIZE32     = 32,
366004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_SIZE64     = 33,
367004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPC32_TLSDESC = 34,
368004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSDESC_CALL    = 35,
369e35badad221354a53bc07a523120ed82d93e0569Michael J. Spencer  R_X86_64_TLSDESC    = 36,
370e35badad221354a53bc07a523120ed82d93e0569Michael J. Spencer  R_X86_64_IRELATIVE  = 37
371004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming};
372004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
373e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer// i386 relocations.
374e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer// TODO: this is just a subset
375e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramerenum {
376e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_NONE          = 0,
377e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_32            = 1,
378e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PC32          = 2,
379e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOT32         = 3,
380e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PLT32         = 4,
381e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_COPY          = 5,
382e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GLOB_DAT      = 6,
383e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_JUMP_SLOT     = 7,
384e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_RELATIVE      = 8,
385e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOTOFF        = 9,
386e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOTPC         = 10,
387e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_32PLT         = 11,
3883cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_TPOFF     = 14,
3893cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_IE        = 15,
3903cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GOTIE     = 16,
3913cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LE        = 17,
3923cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD        = 18,
3933cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM       = 19,
394e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_16            = 20,
395e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PC16          = 21,
396e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_8             = 22,
3973cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_PC8           = 23,
3983cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_32     = 24,
3993cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_PUSH   = 25,
4003cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_CALL   = 26,
4013cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_POP    = 27,
4023cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_32    = 28,
4033cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_PUSH  = 29,
4043cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_CALL  = 30,
4053cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_POP   = 31,
4063cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDO_32    = 32,
4073cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_IE_32     = 33,
4083cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LE_32     = 34,
4093cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DTPMOD32  = 35,
4103cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DTPOFF32  = 36,
4113cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_TPOFF32   = 37,
4123cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GOTDESC   = 39,
4133cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DESC_CALL = 40,
4143cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DESC      = 41,
4153cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_IRELATIVE     = 42,
4163cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_NUM           = 43
417e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer};
418e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer
41910a431824831c1d57a62dd84346387238f516e0cRoman Divacky// ELF Relocation types for PPC32
4202c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divackyenum {
4212c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_NONE                  = 0,      /* No relocation. */
4222c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR32                = 1,
4232c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR24                = 2,
4242c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16                = 3,
4252c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_LO             = 4,
4262c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_HI             = 5,
4272c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_HA             = 6,
4282c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14                = 7,
4292c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14_BRTAKEN        = 8,
4302c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14_BRNTAKEN       = 9,
4312c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL24                 = 10,
4322c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14                 = 11,
4332c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14_BRTAKEN         = 12,
4342c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14_BRNTAKEN        = 13,
4355de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16                 = 14,
4365de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_LO              = 15,
4375de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_HI              = 16,
4385de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_HA              = 17,
439ba6086818d9c5070061f74ac9944666b4312c6f0Ulrich Weigand  R_PPC_REL32                 = 26,
440bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLS                   = 67,
441228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_DTPMOD32              = 68,
442cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16               = 69,
443ba6086818d9c5070061f74ac9944666b4312c6f0Ulrich Weigand  R_PPC_TPREL16_LO            = 70,
444cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16_HI            = 71,
445cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16_HA            = 72,
446228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_TPREL32               = 73,
447cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16              = 74,
448cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_LO           = 75,
449cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_HI           = 76,
450cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_HA           = 77,
451228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_DTPREL32              = 78,
452cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16           = 79,
453cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_LO        = 80,
454cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_HI        = 81,
455cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_HA        = 82,
456cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16           = 83,
457cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_LO        = 84,
458cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_HI        = 85,
459cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_HA        = 86,
460bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_TPREL16           = 87,
461bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_TPREL16_LO        = 88,
462cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TPREL16_HI        = 89,
463cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TPREL16_HA        = 90,
464bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_DTPREL16          = 91,
465bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_DTPREL16_LO       = 92,
466cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_DTPREL16_HI       = 93,
46784569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_GOT_DTPREL16_HA       = 94,
468bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLSGD                 = 95,
469bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLSLD                 = 96,
47084569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16                 = 249,
47184569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_LO              = 250,
47284569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_HI              = 251,
47384569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_HA              = 252
4742c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky};
4752d7a53aec2c6426eba9e5dd6462cc9e86432b410Jason W Kim
47610a431824831c1d57a62dd84346387238f516e0cRoman Divacky// ELF Relocation types for PPC64
47710a431824831c1d57a62dd84346387238f516e0cRoman Divackyenum {
478a6cd815994a30888d579e7731a98e668f07a5965Nico Rieck  R_PPC64_NONE                = 0,
4797b449889e7886b263718b5103538970f287bc37eAdhemerval Zanella  R_PPC64_ADDR32              = 1,
480c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR24              = 2,
481c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR16              = 3,
48210a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_LO           = 4,
48310a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HI           = 5,
484c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR16_HA           = 6,
48510a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR14              = 7,
486c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR14_BRTAKEN      = 8,
487c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR14_BRNTAKEN     = 9,
48810a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_REL24               = 10,
489c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14               = 11,
490c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14_BRTAKEN       = 12,
491c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14_BRNTAKEN      = 13,
4925de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16               = 14,
4935de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_LO            = 15,
4945de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_HI            = 16,
4955de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_HA            = 17,
496a1db5de9e70dd8ffda57b1a4373915ea866b6f1dAdhemerval Zanella  R_PPC64_REL32               = 26,
49710a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR64              = 38,
49810a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HIGHER       = 39,
499f7c1ee79fe90353fcd3f545f9d45a01a837bbf4bUlrich Weigand  R_PPC64_ADDR16_HIGHERA      = 40,
50010a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HIGHEST      = 41,
501f7c1ee79fe90353fcd3f545f9d45a01a837bbf4bUlrich Weigand  R_PPC64_ADDR16_HIGHESTA     = 42,
5027b449889e7886b263718b5103538970f287bc37eAdhemerval Zanella  R_PPC64_REL64               = 44,
50310a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_TOC16               = 47,
50434a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_LO            = 48,
505f8f87dcfceadd1b842d130303a7091ad7d7d67d0Ulrich Weigand  R_PPC64_TOC16_HI            = 49,
50634a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_HA            = 50,
50710a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_TOC                 = 51,
50865e90c036472380bba160c349412f37128608e1cUlrich Weigand  R_PPC64_ADDR16_DS           = 56,
50965e90c036472380bba160c349412f37128608e1cUlrich Weigand  R_PPC64_ADDR16_LO_DS        = 57,
5105de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_DS            = 58,
5115de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_LO_DS         = 59,
51234a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_DS            = 63,
513d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt  R_PPC64_TOC16_LO_DS         = 64,
514d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt  R_PPC64_TLS                 = 67,
515228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_DTPMOD64            = 68,
516cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16             = 69,
517fc7695a653323071ec141aee994e4188592ad1f5Bill Schmidt  R_PPC64_TPREL16_LO          = 70,
518cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HI          = 71,
519a6cd815994a30888d579e7731a98e668f07a5965Nico Rieck  R_PPC64_TPREL16_HA          = 72,
520228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_TPREL64             = 73,
521cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16            = 74,
522349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_DTPREL16_LO         = 75,
523cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HI         = 76,
524349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_DTPREL16_HA         = 77,
525228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_DTPREL64            = 78,
526cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSGD16         = 79,
52757ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt  R_PPC64_GOT_TLSGD16_LO      = 80,
528cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSGD16_HI      = 81,
52957ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt  R_PPC64_GOT_TLSGD16_HA      = 82,
530cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSLD16         = 83,
531349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_GOT_TLSLD16_LO      = 84,
532cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSLD16_HI      = 85,
533349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_GOT_TLSLD16_HA      = 86,
534cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TPREL16_DS      = 87,
535b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt  R_PPC64_GOT_TPREL16_LO_DS   = 88,
536cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TPREL16_HI      = 89,
537b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt  R_PPC64_GOT_TPREL16_HA      = 90,
538cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_DS     = 91,
539cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_LO_DS  = 92,
540cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_HI     = 93,
541cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_HA     = 94,
542cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_DS          = 95,
543cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_LO_DS       = 96,
544cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHER      = 97,
545cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHERA     = 98,
546cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHEST     = 99,
547cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHESTA    = 100,
548cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_DS         = 101,
549cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_LO_DS      = 102,
550cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHER     = 103,
551cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHERA    = 104,
552cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHEST    = 105,
553cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHESTA   = 106,
554349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_TLSGD               = 107,
55584569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_TLSLD               = 108,
55684569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16               = 249,
55784569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_LO            = 250,
55884569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_HI            = 251,
55984569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_HA            = 252
56010a431824831c1d57a62dd84346387238f516e0cRoman Divacky};
56110a431824831c1d57a62dd84346387238f516e0cRoman Divacky
56272062f5744557e270a38192554c3126ea5f97434Tim Northover// ELF Relocation types for AArch64
56372062f5744557e270a38192554c3126ea5f97434Tim Northover
56472062f5744557e270a38192554c3126ea5f97434Tim Northoverenum {
56572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_NONE                        = 0x100,
56672062f5744557e270a38192554c3126ea5f97434Tim Northover
56772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS64                       = 0x101,
56872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS32                       = 0x102,
56972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS16                       = 0x103,
57072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL64                      = 0x104,
57172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL32                      = 0x105,
57272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL16                      = 0x106,
57372062f5744557e270a38192554c3126ea5f97434Tim Northover
57472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G0                = 0x107,
57572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G0_NC             = 0x108,
57672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G1                = 0x109,
57772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G1_NC             = 0x10a,
57872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G2                = 0x10b,
57972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G2_NC             = 0x10c,
58072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G3                = 0x10d,
58172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G0                = 0x10e,
58272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G1                = 0x10f,
58372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G2                = 0x110,
58472062f5744557e270a38192554c3126ea5f97434Tim Northover
58572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LD_PREL_LO19                = 0x111,
58672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_PREL_LO21               = 0x112,
58772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_PREL_PG_HI21            = 0x113,
58872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADD_ABS_LO12_NC             = 0x115,
58972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST8_ABS_LO12_NC           = 0x116,
59072062f5744557e270a38192554c3126ea5f97434Tim Northover
59172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TSTBR14                     = 0x117,
59272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_CONDBR19                    = 0x118,
59372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_JUMP26                      = 0x11a,
59472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_CALL26                      = 0x11b,
59572062f5744557e270a38192554c3126ea5f97434Tim Northover
59672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST16_ABS_LO12_NC          = 0x11c,
59772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST32_ABS_LO12_NC          = 0x11d,
59872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST64_ABS_LO12_NC          = 0x11e,
59972062f5744557e270a38192554c3126ea5f97434Tim Northover
60072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST128_ABS_LO12_NC         = 0x12b,
60172062f5744557e270a38192554c3126ea5f97434Tim Northover
60272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_GOT_PAGE                = 0x137,
60372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LD64_GOT_LO12_NC            = 0x138,
60472062f5744557e270a38192554c3126ea5f97434Tim Northover
60572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G2        = 0x20b,
60672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G1        = 0x20c,
60772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC     = 0x20d,
60872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G0        = 0x20e,
60972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC     = 0x20f,
61072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_HI12       = 0x210,
61172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_LO12       = 0x211,
61272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC    = 0x212,
61372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST8_DTPREL_LO12     = 0x213,
61472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC  = 0x214,
61572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST16_DTPREL_LO12    = 0x215,
61672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 0x216,
61772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST32_DTPREL_LO12    = 0x217,
61872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 0x218,
61972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST64_DTPREL_LO12    = 0x219,
62072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 0x21a,
62172062f5744557e270a38192554c3126ea5f97434Tim Northover
62272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_MOVW_GOTTPREL_G1      = 0x21b,
62372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC   = 0x21c,
62472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21   = 0x21d,
62572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 0x21e,
62672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_LD_GOTTPREL_PREL19    = 0x21f,
62772062f5744557e270a38192554c3126ea5f97434Tim Northover
62872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G2         = 0x220,
62972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G1         = 0x221,
63072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G1_NC      = 0x222,
63172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G0         = 0x223,
63272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G0_NC      = 0x224,
63372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_HI12        = 0x225,
63472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_LO12        = 0x226,
63572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_LO12_NC     = 0x227,
63672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST8_TPREL_LO12      = 0x228,
63772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC   = 0x229,
63872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST16_TPREL_LO12     = 0x22a,
63972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC  = 0x22b,
64072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST32_TPREL_LO12     = 0x22c,
64172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC  = 0x22d,
64272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST64_TPREL_LO12     = 0x22e,
64372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC  = 0x22f,
64472062f5744557e270a38192554c3126ea5f97434Tim Northover
64572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_ADR_PAGE            = 0x232,
64672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_LD64_LO12_NC        = 0x233,
64772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_ADD_LO12_NC         = 0x234,
64872062f5744557e270a38192554c3126ea5f97434Tim Northover
64972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_CALL                = 0x239
65072062f5744557e270a38192554c3126ea5f97434Tim Northover};
65172062f5744557e270a38192554c3126ea5f97434Tim Northover
6522d7a53aec2c6426eba9e5dd6462cc9e86432b410Jason W Kim// ARM Specific e_flags
65397130e2b3de080e231caac86dbce1500e4e7af16Jack Carterenum {
6544bf030402de033aa0f0eb10165a169b9042c65daJoerg Sonnenberger  EF_ARM_SOFT_FLOAT =     0x00000200U,
6554bf030402de033aa0f0eb10165a169b9042c65daJoerg Sonnenberger  EF_ARM_VFP_FLOAT =      0x00000400U,
65697130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_UNKNOWN =   0x00000000U,
65797130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_VER1 =      0x01000000U,
65897130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_VER2 =      0x02000000U,
65997130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_VER3 =      0x03000000U,
66097130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_VER4 =      0x04000000U,
66197130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABI_VER5 =      0x05000000U,
66297130e2b3de080e231caac86dbce1500e4e7af16Jack Carter  EF_ARM_EABIMASK =       0xFF000000U
66397130e2b3de080e231caac86dbce1500e4e7af16Jack Carter};
6642d7a53aec2c6426eba9e5dd6462cc9e86432b410Jason W Kim
66513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim// ELF Relocation types for ARM
66613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim// Meets 2.08 ABI Specs.
66713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim
66813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kimenum {
66913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_NONE                  = 0x00,
67013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PC24                  = 0x01,
67113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ABS32                 = 0x02,
67213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_REL32                 = 0x03,
67313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_PC_G0             = 0x04,
67413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ABS16                 = 0x05,
67513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ABS12                 = 0x06,
67613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_ABS5              = 0x07,
67713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ABS8                  = 0x08,
67813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_SBREL32               = 0x09,
67913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_CALL              = 0x0a,
68013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_PC8               = 0x0b,
68113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_BREL_ADJ              = 0x0c,
68213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_DESC              = 0x0d,
68313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_SWI8              = 0x0e,
68413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_XPC25                 = 0x0f,
68513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_XPC22             = 0x10,
68613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_DTPMOD32          = 0x11,
68713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_DTPOFF32          = 0x12,
68813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_TPOFF32           = 0x13,
68913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_COPY                  = 0x14,
69013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GLOB_DAT              = 0x15,
69113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_JUMP_SLOT             = 0x16,
69213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_RELATIVE              = 0x17,
69313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOTOFF32              = 0x18,
69413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_BASE_PREL             = 0x19,
69513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOT_BREL              = 0x1a,
69613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PLT32                 = 0x1b,
69713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_CALL                  = 0x1c,
69813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_JUMP24                = 0x1d,
69913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_JUMP24            = 0x1e,
70013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_BASE_ABS              = 0x1f,
70113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PCREL_7_0         = 0x20,
70213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PCREL_15_8        = 0x21,
70313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PCREL_23_15       = 0x22,
70413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_SBREL_11_0_NC     = 0x23,
70513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SBREL_19_12_NC    = 0x24,
70613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SBREL_27_20_CK    = 0x25,
70713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TARGET1               = 0x26,
70813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_SBREL31               = 0x27,
70913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_V4BX                  = 0x28,
71013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TARGET2               = 0x29,
71113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PREL31                = 0x2a,
71213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVW_ABS_NC           = 0x2b,
71313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVT_ABS              = 0x2c,
71413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVW_PREL_NC          = 0x2d,
71513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVT_PREL             = 0x2e,
71613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVW_ABS_NC       = 0x2f,
71713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVT_ABS          = 0x30,
71813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVW_PREL_NC      = 0x31,
71913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVT_PREL         = 0x32,
72013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_JUMP19            = 0x33,
72113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_JUMP6             = 0x34,
72213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_ALU_PREL_11_0     = 0x35,
72313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_PC12              = 0x36,
72413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ABS32_NOI             = 0x37,
72513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_REL32_NOI             = 0x38,
72613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PC_G0_NC          = 0x39,
72713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PC_G0             = 0x3a,
72813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PC_G1_NC          = 0x3b,
72913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PC_G1             = 0x3c,
73013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_PC_G2             = 0x3d,
73113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_PC_G1             = 0x3e,
73213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_PC_G2             = 0x3f,
73313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_PC_G0            = 0x40,
73413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_PC_G1            = 0x41,
73513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_PC_G2            = 0x42,
73613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_PC_G0             = 0x43,
73713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_PC_G1             = 0x44,
73813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_PC_G2             = 0x45,
73913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SB_G0_NC          = 0x46,
74013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SB_G0             = 0x47,
74113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SB_G1_NC          = 0x48,
74213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SB_G1             = 0x49,
74313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ALU_SB_G2             = 0x4a,
74413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_SB_G0             = 0x4b,
74513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_SB_G1             = 0x4c,
74613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDR_SB_G2             = 0x4d,
74713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_SB_G0            = 0x4e,
74813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_SB_G1            = 0x4f,
74913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDRS_SB_G2            = 0x50,
75013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_SB_G0             = 0x51,
75113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_SB_G1             = 0x52,
75213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_LDC_SB_G2             = 0x53,
75313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVW_BREL_NC          = 0x54,
75413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVT_BREL             = 0x55,
75513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_MOVW_BREL             = 0x56,
75613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVW_BREL_NC      = 0x57,
75713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVT_BREL         = 0x58,
75813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_MOVW_BREL         = 0x59,
75913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_GOTDESC           = 0x5a,
76013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_CALL              = 0x5b,
76113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_DESCSEQ           = 0x5c,
76213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_TLS_CALL          = 0x5d,
76313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PLT32_ABS             = 0x5e,
76413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOT_ABS               = 0x5f,
76513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOT_PREL              = 0x60,
76613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOT_BREL12            = 0x61,
76713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOTOFF12              = 0x62,
76813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GOTRELAX              = 0x63,
76913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GNU_VTENTRY           = 0x64,
77013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_GNU_VTINHERIT         = 0x65,
77113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_JUMP11            = 0x66,
77213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_JUMP8             = 0x67,
77313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_GD32              = 0x68,
77413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_LDM32             = 0x69,
77513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_LDO32             = 0x6a,
77613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_IE32              = 0x6b,
77713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_LE32              = 0x6c,
77813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_LDO12             = 0x6d,
77913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_LE12              = 0x6e,
78013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_TLS_IE12GP            = 0x6f,
78113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_0             = 0x70,
78213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_1             = 0x71,
78313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_2             = 0x72,
78413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_3             = 0x73,
78513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_4             = 0x74,
78613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_5             = 0x75,
78713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_6             = 0x76,
78813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_7             = 0x77,
78913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_8             = 0x78,
79013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_9             = 0x79,
79113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_10            = 0x7a,
79213534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_11            = 0x7b,
79313534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_12            = 0x7c,
79413534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_13            = 0x7d,
79513534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_14            = 0x7e,
79613534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_PRIVATE_15            = 0x7f,
79713534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_ME_TOO                = 0x80,
79813534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_TLS_DESCSEQ16     = 0x81,
79913534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim  R_ARM_THM_TLS_DESCSEQ32     = 0x82
80013534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim};
80113534672deffb571d90f2c2f0a237c67d5aa0594Jason W Kim
80284bfc2f090639f933df06cc675c4385511516befAkira Hatanaka// Mips Specific e_flags
80384bfc2f090639f933df06cc675c4385511516befAkira Hatanakaenum {
80484bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_NOREORDER = 0x00000001, // Don't reorder instructions
80584bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_PIC       = 0x00000002, // Position independent code
80684bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_CPIC      = 0x00000004, // Call object with Position independent code
8075cdeca8b1d726790fe9687bc4a4d615d299bc151Jack Carter  EF_MIPS_ABI_O32   = 0x00001000, // This file follows the first MIPS 32 bit ABI
808c989c61798783f99abe7f8c27baf76bd2aea5067Jack Carter
809ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter  //ARCH_ASE
810ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter  EF_MIPS_MICROMIPS = 0x02000000, // microMIPS
811c989c61798783f99abe7f8c27baf76bd2aea5067Jack Carter  EF_MIPS_ARCH_ASE_M16 =
812c989c61798783f99abe7f8c27baf76bd2aea5067Jack Carter                      0x04000000, // Has Mips-16 ISA extensions
813ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter  //ARCH
81484bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_1    = 0x00000000, // MIPS1 instruction set
81584bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_2    = 0x10000000, // MIPS2 instruction set
81684bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_3    = 0x20000000, // MIPS3 instruction set
81784bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_4    = 0x30000000, // MIPS4 instruction set
81884bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_5    = 0x40000000, // MIPS5 instruction set
819a551a48402385cf3f4b754dc72264b2f0974b1a6Akira Hatanaka  EF_MIPS_ARCH_32   = 0x50000000, // MIPS32 instruction set per linux not elf.h
820a551a48402385cf3f4b754dc72264b2f0974b1a6Akira Hatanaka  EF_MIPS_ARCH_64   = 0x60000000, // MIPS64 instruction set per linux not elf.h
82184bfc2f090639f933df06cc675c4385511516befAkira Hatanaka  EF_MIPS_ARCH_32R2 = 0x70000000, // mips32r2
822c989c61798783f99abe7f8c27baf76bd2aea5067Jack Carter  EF_MIPS_ARCH_64R2 = 0x80000000, // mips64r2
823c989c61798783f99abe7f8c27baf76bd2aea5067Jack Carter  EF_MIPS_ARCH      = 0xf0000000  // Mask for applying EF_MIPS_ARCH_ variant
82484bfc2f090639f933df06cc675c4385511516befAkira Hatanaka};
82584bfc2f090639f933df06cc675c4385511516befAkira Hatanaka
82688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka// ELF Relocation types for Mips
82784bfc2f090639f933df06cc675c4385511516befAkira Hatanaka// .
82888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanakaenum {
82988c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_NONE              =  0,
83088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_16                =  1,
83188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_32                =  2,
83288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_REL32             =  3,
83388c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_26                =  4,
83488c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_HI16              =  5,
83588c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_LO16              =  6,
83688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GPREL16           =  7,
83788c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_LITERAL           =  8,
83888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT16             =  9,
839e3d3572e282733bd7aa5ac14115ed0804174e426Bruno Cardoso Lopes  R_MIPS_GOT               =  9,
84088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_PC16              = 10,
84188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_CALL16            = 11,
84288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GPREL32           = 12,
8433af1c9d3343357849f19f7467f9c16220ad37ca4Akira Hatanaka  R_MIPS_UNUSED1           = 13,
8443af1c9d3343357849f19f7467f9c16220ad37ca4Akira Hatanaka  R_MIPS_UNUSED2           = 14,
84588c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_SHIFT5            = 16,
84688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_SHIFT6            = 17,
84788c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_64                = 18,
84888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT_DISP          = 19,
84988c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT_PAGE          = 20,
85088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT_OFST          = 21,
85188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT_HI16          = 22,
85288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GOT_LO16          = 23,
85388c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_SUB               = 24,
85488c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_INSERT_A          = 25,
85588c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_INSERT_B          = 26,
85688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_DELETE            = 27,
85788c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_HIGHER            = 28,
85888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_HIGHEST           = 29,
85988c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_CALL_HI16         = 30,
86088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_CALL_LO16         = 31,
86188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_SCN_DISP          = 32,
86288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_REL16             = 33,
86388c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_ADD_IMMEDIATE     = 34,
86488c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_PJUMP             = 35,
86588c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_RELGOT            = 36,
86688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_JALR              = 37,
86788c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPMOD32      = 38,
86888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPREL32      = 39,
86988c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPMOD64      = 40,
87088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPREL64      = 41,
87188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_GD            = 42,
87288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_LDM           = 43,
87388c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPREL_HI16   = 44,
87488c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_DTPREL_LO16   = 45,
87588c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_GOTTPREL      = 46,
87688c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_TPREL32       = 47,
87788c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_TPREL64       = 48,
87888c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_TPREL_HI16    = 49,
87988c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_TLS_TPREL_LO16    = 50,
88088c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_GLOB_DAT          = 51,
88188c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_COPY              = 126,
88288c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_JUMP_SLOT         = 127,
88388c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka  R_MIPS_NUM               = 218
88488c1103c223c1e3eb430ce7081b347e1a2346967Akira Hatanaka};
8854b04713423c6da988db75c7546baa3db7ddfa119Wesley Peck
886ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter// Special values for the st_other field in the symbol table entry for MIPS.
887ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carterenum {
888ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter  STO_MIPS_MICROMIPS       = 0x80 // MIPS Specific ISA for MicroMips
889ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter};
890ccb3c9c2702f548fd0a7d60a622e6f4fdf0940e7Jack Carter
8918ceffeb95cca477d1faf176e95140272a28cb91cSid Manning// Hexagon Specific e_flags
8928ceffeb95cca477d1faf176e95140272a28cb91cSid Manning// Release 5 ABI
8938ceffeb95cca477d1faf176e95140272a28cb91cSid Manningenum {
8948ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  // Object processor version flags, bits[3:0]
8958ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_MACH_V2      = 0x00000001,   // Hexagon V2
8968ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_MACH_V3      = 0x00000002,   // Hexagon V3
8978ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_MACH_V4      = 0x00000003,   // Hexagon V4
8988ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_MACH_V5      = 0x00000004,   // Hexagon V5
8998ceffeb95cca477d1faf176e95140272a28cb91cSid Manning
9008ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  // Highest ISA version flags
9018ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_ISA_MACH     = 0x00000000,   // Same as specified in bits[3:0]
9028ceffeb95cca477d1faf176e95140272a28cb91cSid Manning                                          // of e_flags
9038ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_ISA_V2       = 0x00000010,   // Hexagon V2 ISA
9048ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_ISA_V3       = 0x00000020,   // Hexagon V3 ISA
9058ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_ISA_V4       = 0x00000030,   // Hexagon V4 ISA
9068ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  EF_HEXAGON_ISA_V5       = 0x00000040    // Hexagon V5 ISA
9078ceffeb95cca477d1faf176e95140272a28cb91cSid Manning};
9088ceffeb95cca477d1faf176e95140272a28cb91cSid Manning
9098ceffeb95cca477d1faf176e95140272a28cb91cSid Manning// Hexagon specific Section indexes for common small data
910dc08bfbd565ba6540be698bba551b2039661299dJack Carter// Release 5 ABI
9118ceffeb95cca477d1faf176e95140272a28cb91cSid Manningenum {
9128ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  SHN_HEXAGON_SCOMMON     = 0xff00,       // Other access sizes
9138ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  SHN_HEXAGON_SCOMMON_1   = 0xff01,       // Byte-sized access
9148ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  SHN_HEXAGON_SCOMMON_2   = 0xff02,       // Half-word-sized access
9158ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  SHN_HEXAGON_SCOMMON_4   = 0xff03,       // Word-sized access
9168ceffeb95cca477d1faf176e95140272a28cb91cSid Manning  SHN_HEXAGON_SCOMMON_8   = 0xff04        // Double-word-size access
917dc08bfbd565ba6540be698bba551b2039661299dJack Carter};
9188ceffeb95cca477d1faf176e95140272a28cb91cSid Manning
91950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow// ELF Relocation types for Hexagon
9208ceffeb95cca477d1faf176e95140272a28cb91cSid Manning// Release 5 ABI
92150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clowenum {
92250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_NONE              =  0,
92350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B22_PCREL         =  1,
92450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B15_PCREL         =  2,
92550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B7_PCREL          =  3,
92650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_LO16              =  4,
92750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_HI16              =  5,
92850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_32                =  6,
92950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_16                =  7,
93050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_8                 =  8,
93150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GPREL16_0         =  9,
93250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GPREL16_1         =  10,
93350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GPREL16_2         =  11,
93450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GPREL16_3         =  12,
93550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_HL16              =  13,
93650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B13_PCREL         =  14,
93750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B9_PCREL          =  15,
93850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B32_PCREL_X       =  16,
93950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_32_6_X            =  17,
94050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B22_PCREL_X       =  18,
94150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B15_PCREL_X       =  19,
94250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B13_PCREL_X       =  20,
94350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B9_PCREL_X        =  21,
94450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_B7_PCREL_X        =  22,
94550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_16_X              =  23,
94650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_12_X              =  24,
94750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_11_X              =  25,
94850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_10_X              =  26,
94950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_9_X               =  27,
95050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_8_X               =  28,
95150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_7_X               =  29,
95250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_6_X               =  30,
95350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_32_PCREL          =  31,
95450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_COPY              =  32,
95550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GLOB_DAT          =  33,
95650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_JMP_SLOT          =  34,
95750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_RELATIVE          =  35,
95850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_PLT_B22_PCREL     =  36,
95950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_LO16       =  37,
96050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_HI16       =  38,
96150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_32         =  39,
96250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_LO16          =  40,
96350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_HI16          =  41,
96450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_32            =  42,
96550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_16            =  43,
96650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPMOD_32         =  44,
96750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_LO16       =  45,
96850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_HI16       =  46,
96950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_32         =  47,
97050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_16         =  48,
97150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_PLT_B22_PCREL  =  49,
97250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_LO16       =  50,
97350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_HI16       =  51,
97450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_32         =  52,
97550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_16         =  53,
97650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_LO16           =  54,
97750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_HI16           =  55,
97850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_32             =  56,
97950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_LO16       =  57,
98050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_HI16       =  58,
98150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_32         =  59,
98250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_16         =  60,
98350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_LO16        =  61,
98450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_HI16        =  62,
98550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_32          =  63,
98650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_16          =  64,
98750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_6_PCREL_X         =  65,
98850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_32_6_X     =  66,
98950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_16_X       =  67,
99050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOTREL_11_X       =  68,
99150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_32_6_X        =  69,
99250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_16_X          =  70,
99350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GOT_11_X          =  71,
99450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_32_6_X     =  72,
99550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_16_X       =  73,
99650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_DTPREL_11_X       =  74,
99750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_32_6_X     =  75,
99850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_16_X       =  76,
99950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_GD_GOT_11_X       =  77,
100050b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_32_6_X         =  78,
100150b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_16_X           =  79,
100250b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_32_6_X     =  80,
100350b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_16_X       =  81,
100450b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_IE_GOT_11_X       =  82,
100550b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_32_6_X      =  83,
100650b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_16_X        =  84,
100750b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow  R_HEX_TPREL_11_X        =  85
100850b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow};
100950b4c52633b0c933aabcd0741d1dae751ba339ddMarshall Clow
1010820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford// ELF Relocation types for S390/zSeries
1011820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandifordenum {
1012820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_NONE        =  0,
1013820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_8           =  1,
1014820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_12          =  2,
1015820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_16          =  3,
1016820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_32          =  4,
1017820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PC32        =  5,
1018820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOT12       =  6,
1019820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOT32       =  7,
1020820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLT32       =  8,
1021820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_COPY        =  9,
1022820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GLOB_DAT    = 10,
1023820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_JMP_SLOT    = 11,
1024820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_RELATIVE    = 12,
1025820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTOFF      = 13,
1026820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPC       = 14,
1027820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOT16       = 15,
1028820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PC16        = 16,
1029820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PC16DBL     = 17,
1030820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLT16DBL    = 18,
1031820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PC32DBL     = 19,
1032820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLT32DBL    = 20,
1033820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPCDBL    = 21,
1034820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_64          = 22,
1035820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PC64        = 23,
1036820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOT64       = 24,
1037820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLT64       = 25,
1038820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTENT      = 26,
1039820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTOFF16    = 27,
1040820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTOFF64    = 28,
1041820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLT12    = 29,
1042820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLT16    = 30,
1043820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLT32    = 31,
1044820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLT64    = 32,
1045820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLTENT   = 33,
1046820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLTOFF16    = 34,
1047820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLTOFF32    = 35,
1048820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_PLTOFF64    = 36,
1049820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LOAD    = 37,
1050820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GDCALL  = 38,
1051820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LDCALL  = 39,
1052820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GD32    = 40,
1053820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GD64    = 41,
1054820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GOTIE12 = 42,
1055820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GOTIE32 = 43,
1056820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GOTIE64 = 44,
1057820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LDM32   = 45,
1058820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LDM64   = 46,
1059820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_IE32    = 47,
1060820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_IE64    = 48,
1061820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_IEENT   = 49,
1062820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LE32    = 50,
1063820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LE64    = 51,
1064820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LDO32   = 52,
1065820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_LDO64   = 53,
1066820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_DTPMOD  = 54,
1067820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_DTPOFF  = 55,
1068820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_TPOFF   = 56,
1069820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_20          = 57,
1070820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOT20       = 58,
1071820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_GOTPLT20    = 59,
1072820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_TLS_GOTIE20 = 60,
1073820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford  R_390_IRELATIVE   = 61
1074820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford};
1075820b3fd7716cf5ab26961d1b2b21fd5d0f330fe1Richard Sandiford
10766c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Section header.
10776c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Shdr {
10786c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_name;      // Section name (index into string table)
10796c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_type;      // Section type (SHT_*)
10806c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_flags;     // Section flags (SHF_*)
10816c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr sh_addr;      // Address where section is to be loaded
10826c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off  sh_offset;    // File offset of section data, in bytes
10836c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_size;      // Size of section, in bytes
108463b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman  Elf32_Word sh_link;      // Section type-specific header table index link
10856c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_info;      // Section type-specific extra information
10866c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_addralign; // Section address alignment
10876c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word sh_entsize;   // Size of records contained within the section
10886c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
10896c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
1090620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke// Section header for ELF64 - same fields as ELF32, different types.
1091e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaekestruct Elf64_Shdr {
1092c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word  sh_name;
1093c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word  sh_type;
1094620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Xword sh_flags;
1095620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Addr  sh_addr;
1096620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Off   sh_offset;
1097620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Xword sh_size;
1098c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word  sh_link;
1099c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word  sh_info;
1100620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Xword sh_addralign;
1101620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Xword sh_entsize;
1102e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaeke};
1103620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke
11046c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Special section indices.
11056c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
11066c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_UNDEF     = 0,      // Undefined, missing, irrelevant, or meaningless
11076c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_LORESERVE = 0xff00, // Lowest reserved index
11086c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_LOPROC    = 0xff00, // Lowest processor-specific index
11096c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_HIPROC    = 0xff1f, // Highest processor-specific index
1110fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  SHN_LOOS      = 0xff20, // Lowest operating system-specific index
1111fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  SHN_HIOS      = 0xff3f, // Highest operating system-specific index
11126c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_ABS       = 0xfff1, // Symbol has absolute value; does not need relocation
11136c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_COMMON    = 0xfff2, // FORTRAN COMMON or C external global variables
11147be2c33193aeada8c0ff3555ea54b930f204132aRafael Espindola  SHN_XINDEX    = 0xffff, // Mark that the index is >= SHN_LORESERVE
11156c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  SHN_HIRESERVE = 0xffff  // Highest reserved index
11166c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
11176c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
11186c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Section types.
11196c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
1120b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_NULL          = 0,  // No associated section (inactive entry).
1121b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_PROGBITS      = 1,  // Program-defined contents.
1122b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_SYMTAB        = 2,  // Symbol table.
1123b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_STRTAB        = 3,  // String table.
1124b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_RELA          = 4,  // Relocation entries; explicit addends.
1125b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_HASH          = 5,  // Symbol hash table.
1126b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_DYNAMIC       = 6,  // Information for dynamic linking.
1127b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_NOTE          = 7,  // Information about the file.
1128b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_NOBITS        = 8,  // Data occupies no space in the file.
1129b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_REL           = 9,  // Relocation entries; no explicit addends.
1130b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_SHLIB         = 10, // Reserved.
1131b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_DYNSYM        = 11, // Symbol table.
1132cbda61a468b4a2b33a54781d65023da7d9c8d291Michael J. Spencer  SHT_INIT_ARRAY    = 14, // Pointers to initialization functions.
1133b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_FINI_ARRAY    = 15, // Pointers to termination functions.
1134b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_PREINIT_ARRAY = 16, // Pointers to pre-init functions.
1135b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_GROUP         = 17, // Section group.
1136cbda61a468b4a2b33a54781d65023da7d9c8d291Michael J. Spencer  SHT_SYMTAB_SHNDX  = 18, // Indices for SHN_XINDEX entries.
1137b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_LOOS          = 0x60000000, // Lowest operating system-specific type.
11386aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  SHT_GNU_ATTRIBUTES= 0x6ffffff5, // Object attributes.
11396aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  SHT_GNU_HASH      = 0x6ffffff6, // GNU-style hash table.
11402d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  SHT_GNU_verdef    = 0x6ffffffd, // GNU version definitions.
11412d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  SHT_GNU_verneed   = 0x6ffffffe, // GNU version references.
11422d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  SHT_GNU_versym    = 0x6fffffff, // GNU symbol versions table.
1143b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_HIOS          = 0x6fffffff, // Highest operating system-specific type.
1144dc08bfbd565ba6540be698bba551b2039661299dJack Carter  SHT_LOPROC        = 0x70000000, // Lowest processor arch-specific type.
1145cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  // Fixme: All this is duplicated in MCSectionELF. Why??
1146cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  // Exception Index table
1147cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  SHT_ARM_EXIDX           = 0x70000001U,
1148cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  // BPABI DLL dynamic linking pre-emption map
1149cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  SHT_ARM_PREEMPTMAP      = 0x70000002U,
1150cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  //  Object file compatibility attributes
1151cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  SHT_ARM_ATTRIBUTES      = 0x70000003U,
1152cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  SHT_ARM_DEBUGOVERLAY    = 0x70000004U,
1153cecbc3d28277ff4916326311cbf87335ed05d106Rafael Espindola  SHT_ARM_OVERLAYSECTION  = 0x70000005U,
1154dc08bfbd565ba6540be698bba551b2039661299dJack Carter  SHT_HEX_ORDERED         = 0x70000000, // Link editor is to sort the entries in
1155cde81689649ca62688e22a2d068ca893ce221332Shankar Easwaran                                        // this section based on their sizes
11560cf5e3d51dd455a174a8f00cfa6b63c11e535434Rafael Espindola  SHT_X86_64_UNWIND       = 0x70000001, // Unwind information
11570cf5e3d51dd455a174a8f00cfa6b63c11e535434Rafael Espindola
1158c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter  SHT_MIPS_REGINFO        = 0x70000006, // Register usage information
1159c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter  SHT_MIPS_OPTIONS        = 0x7000000d, // General options
1160c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter
1161dc08bfbd565ba6540be698bba551b2039661299dJack Carter  SHT_HIPROC        = 0x7fffffff, // Highest processor arch-specific type.
1162b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_LOUSER        = 0x80000000, // Lowest type reserved for applications.
1163b676d9815dc7ce3a14d655322f307f335708155bMatt Fleming  SHT_HIUSER        = 0xffffffff  // Highest type reserved for applications.
11646c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
11656c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
11666c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Section flags.
11676c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
11681c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Section data should be writable during execution.
11691c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_WRITE = 0x1,
11701c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11711c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Section occupies memory during program execution.
11721c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_ALLOC = 0x2,
11731c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11741c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Section contains executable machine instructions.
11751c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_EXECINSTR = 0x4,
11761c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11771c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // The data in this section may be merged.
11781c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_MERGE = 0x10,
11791c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11801c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // The data in this section is null-terminated strings.
11811c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_STRINGS = 0x20,
11821c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11831c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // A field in this section holds a section header table index.
11841c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_INFO_LINK = 0x40U,
11851c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11861c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Adds special ordering requirements for link editors.
11871c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_LINK_ORDER = 0x80U,
11881c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11891c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // This section requires special OS-specific processing to avoid incorrect
11901c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // behavior.
11911c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_OS_NONCONFORMING = 0x100U,
11921c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11931c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // This section is a member of a section group.
11941c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_GROUP = 0x200U,
11951c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
11961c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // This section holds Thread-Local Storage.
11971c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  SHF_TLS = 0x400U,
11981c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
1199766f25306af343fb2784350cb4d8cd9ca180f0d3Benjamin Kramer  // This section is excluded from the final executable or shared library.
1200766f25306af343fb2784350cb4d8cd9ca180f0d3Benjamin Kramer  SHF_EXCLUDE = 0x80000000U,
1201766f25306af343fb2784350cb4d8cd9ca180f0d3Benjamin Kramer
12021c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Start of target-specific flags.
12031c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
12041c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// XCORE_SHF_CP_SECTION - All sections with the "c" flag are grouped
12051c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// together by the linker to form the constant pool and the cp register is
12061c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// set to the start of the constant pool by the boot code.
12071c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  XCORE_SHF_CP_SECTION = 0x800U,
12081c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
12091c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// XCORE_SHF_DP_SECTION - All sections with the "d" flag are grouped
12101c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// together by the linker to form the data section and the dp register is
12111c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  /// set to the start of the section by the boot code.
12121c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  XCORE_SHF_DP_SECTION = 0x1000U,
12131c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola
1214fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  SHF_MASKOS   = 0x0ff00000,
1215fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
12161c13026e8f94bd332c0979baa9c777da99d48736Rafael Espindola  // Bits indicating processor-specific flags.
1217fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  SHF_MASKPROC = 0xf0000000,
1218fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
1219fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // If an object file section does not have this flag set, then it may not hold
1220fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // more than 2GB and can be freely referred to in objects using smaller code
1221fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // models. Otherwise, only objects using larger code models can refer to them.
1222fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // For example, a medium code model object can refer to data in a section that
1223fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // sets this flag besides being able to refer to data in a section that does
1224fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // not set it; likewise, a small code model object can refer only to code in a
1225fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // section that does not set this flag.
1226cde81689649ca62688e22a2d068ca893ce221332Shankar Easwaran  SHF_X86_64_LARGE = 0x10000000,
1227cde81689649ca62688e22a2d068ca893ce221332Shankar Easwaran
1228dc08bfbd565ba6540be698bba551b2039661299dJack Carter  // All sections with the GPREL flag are grouped into a global data area
1229cde81689649ca62688e22a2d068ca893ce221332Shankar Easwaran  // for faster accesses
1230c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter  SHF_HEX_GPREL = 0x10000000,
1231cde81689649ca62688e22a2d068ca893ce221332Shankar Easwaran
1232c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter  // Do not strip this section. FIXME: We need target specific SHF_ enums.
1233c91cbb9b0c90a480299cc7deaef166d47a61d9dfJack Carter  SHF_MIPS_NOSTRIP = 0x8000000
12346c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
12356c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
12362ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola// Section Group Flags
12372ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindolaenum {
12382ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola  GRP_COMDAT = 0x1,
12392ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola  GRP_MASKOS = 0x0ff00000,
12402ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola  GRP_MASKPROC = 0xf0000000
12412ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola};
12422ff9e83a826c1c2ee0f1c6072d3d97d5b10678eeRafael Espindola
12439a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Symbol table entries for ELF32.
12446c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Sym {
12456c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    st_name;  // Symbol name (index into string table)
12466c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr    st_value; // Value or address associated with the symbol
12476c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    st_size;  // Size of the symbol
12486c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  unsigned char st_info;  // Symbol's type and binding attributes
12496c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  unsigned char st_other; // Must be zero; reserved
12506c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    st_shndx; // Which section (header table index) it's defined in
125163b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman
12526c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // These accessors and mutators correspond to the ELF32_ST_BIND,
12536c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:
1254314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  unsigned char getBinding() const { return st_info >> 4; }
1255314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  unsigned char getType() const { return st_info & 0x0f; }
1256314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setBinding(unsigned char b) { setBindingAndType(b, getType()); }
1257314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setType(unsigned char t) { setBindingAndType(getBinding(), t); }
1258314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setBindingAndType(unsigned char b, unsigned char t) {
12596c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke    st_info = (b << 4) + (t & 0x0f);
12606c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  }
12616c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
12626c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
12639a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Symbol table entries for ELF64.
12649a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonstruct Elf64_Sym {
12659a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Word      st_name;  // Symbol name (index into string table)
12669a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char   st_info;  // Symbol's type and binding attributes
12679a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char   st_other; // Must be zero; reserved
1268dc08bfbd565ba6540be698bba551b2039661299dJack Carter  Elf64_Half      st_shndx; // Which section (header tbl index) it's defined in
12699a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Addr      st_value; // Value or address associated with the symbol
12709a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Xword     st_size;  // Size of the symbol
12719a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
12729a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  // These accessors and mutators are identical to those defined for ELF32
12739a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  // symbol table entries.
12749a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getBinding() const { return st_info >> 4; }
12759a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getType() const { return st_info & 0x0f; }
12769a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  void setBinding(unsigned char b) { setBindingAndType(b, getType()); }
12779a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  void setType(unsigned char t) { setBindingAndType(getBinding(), t); }
12789a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  void setBindingAndType(unsigned char b, unsigned char t) {
12799a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson    st_info = (b << 4) + (t & 0x0f);
12809a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  }
12819a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
12829a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
12836b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Fleming// The size (in bytes) of symbol table entries.
12846b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Flemingenum {
12856b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Fleming  SYMENTRY_SIZE32 = 16, // 32-bit symbol entry size
12866b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Fleming  SYMENTRY_SIZE64 = 24  // 64-bit symbol entry size.
12876b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Fleming};
12886b2e257e74b2c8e2f93bb244e0c80cb73005b74aMatt Fleming
12896c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Symbol bindings.
12906c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
12916c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STB_LOCAL = 0,   // Local symbol, not visible outside obj file containing def
12926c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STB_GLOBAL = 1,  // Global symbol, visible to all object files being combined
12936c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STB_WEAK = 2,    // Weak symbol, like global but lower-precedence
1294fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  STB_LOOS   = 10, // Lowest operating system-specific binding type
1295fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  STB_HIOS   = 12, // Highest operating system-specific binding type
12966c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STB_LOPROC = 13, // Lowest processor-specific binding type
12976c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STB_HIPROC = 15  // Highest processor-specific binding type
12986c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
12996c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
13006c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Symbol types.
13016c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
13026c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_NOTYPE  = 0,   // Symbol's type is not specified
13036c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_OBJECT  = 1,   // Symbol is a data object (variable, array, etc.)
13046c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_FUNC    = 2,   // Symbol is executable code (function, etc.)
13056c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_SECTION = 3,   // Symbol refers to a section
13066c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_FILE    = 4,   // Local, absolute symbol that refers to a file
1307cbda61a468b4a2b33a54781d65023da7d9c8d291Michael J. Spencer  STT_COMMON  = 5,   // An uninitialized common block
130853621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman  STT_TLS     = 6,   // Thread local data object
1309fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  STT_LOOS    = 7,   // Lowest operating system-specific symbol type
1310fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  STT_HIOS    = 8,   // Highest operating system-specific symbol type
1311a0c17a495b12debcb7f206993bbc6020e2e6e8dfRoman Divacky  STT_GNU_IFUNC = 10, // GNU indirect function
13126c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_LOPROC  = 13,  // Lowest processor-specific symbol type
13136c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  STT_HIPROC  = 15   // Highest processor-specific symbol type
13146c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
13156c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
131653621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedmanenum {
131753621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman  STV_DEFAULT   = 0,  // Visibility is specified by binding type
131853621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman  STV_INTERNAL  = 1,  // Defined by processor supplements
131953621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman  STV_HIDDEN    = 2,  // Not visible to other components
132053621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman  STV_PROTECTED = 3   // Visible in other components but not preemptable
132153621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman};
132253621a1a7376cba5d0a22c12a171933eb8c6d3f6Eli Friedman
13236d3a278aabb0007e75a6c36c904538950e4b0093Michael J. Spencer// Symbol number.
13246d3a278aabb0007e75a6c36c904538950e4b0093Michael J. Spencerenum {
13256d3a278aabb0007e75a6c36c904538950e4b0093Michael J. Spencer  STN_UNDEF = 0
13266d3a278aabb0007e75a6c36c904538950e4b0093Michael J. Spencer};
13276d3a278aabb0007e75a6c36c904538950e4b0093Michael J. Spencer
13286c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Relocation entry, without explicit addend.
13296c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Rel {
133063b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman  Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)
13316c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word r_info;   // Symbol table index and type of relocation to apply
133263b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman
13336c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
13346c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // and ELF32_R_INFO macros defined in the ELF specification:
1335314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  Elf32_Word getSymbol() const { return (r_info >> 8); }
1336314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  unsigned char getType() const { return (unsigned char) (r_info & 0x0ff); }
1337314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setSymbol(Elf32_Word s) { setSymbolAndType(s, getType()); }
1338314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setType(unsigned char t) { setSymbolAndType(getSymbol(), t); }
1339314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setSymbolAndType(Elf32_Word s, unsigned char t) {
13406c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke    r_info = (s << 8) + t;
13411461520f8cba8ebbdfd832d5396079888f1ab96eDouglas Gregor  }
13426c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
13436c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
13446c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Relocation entry with explicit addend.
13456c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Rela {
134663b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman  Elf32_Addr  r_offset; // Location (file byte offset, or program virtual addr)
13476c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word  r_info;   // Symbol table index and type of relocation to apply
13486c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Sword r_addend; // Compute value for relocatable field by adding this
134963b3afa98460ce38a1c48d3c44ef6edfdaf37b77Misha Brukman
13506c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,
13516c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  // and ELF32_R_INFO macros defined in the ELF specification:
1352314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  Elf32_Word getSymbol() const { return (r_info >> 8); }
1353314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  unsigned char getType() const { return (unsigned char) (r_info & 0x0ff); }
1354314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setSymbol(Elf32_Word s) { setSymbolAndType(s, getType()); }
1355314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setType(unsigned char t) { setSymbolAndType(getSymbol(), t); }
1356314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson  void setSymbolAndType(Elf32_Word s, unsigned char t) {
13576c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke    r_info = (s << 8) + t;
13581461520f8cba8ebbdfd832d5396079888f1ab96eDouglas Gregor  }
13596c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
13606c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
1361004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming// Relocation entry, without explicit addend.
1362004c82ad7c0d2da761726f063373c28ffd18e66dMatt Flemingstruct Elf64_Rel {
1363004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr).
1364004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  Elf64_Xword r_info;   // Symbol table index and type of relocation to apply.
1365004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
1366004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,
1367004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  // and ELF64_R_INFO macros defined in the ELF specification:
1368318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  Elf64_Word getSymbol() const { return (r_info >> 32); }
1369318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  Elf64_Word getType() const {
1370318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover    return (Elf64_Word) (r_info & 0xffffffffL);
1371004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  }
1372318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setSymbol(Elf64_Word s) { setSymbolAndType(s, getType()); }
1373318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setType(Elf64_Word t) { setSymbolAndType(getSymbol(), t); }
1374318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setSymbolAndType(Elf64_Word s, Elf64_Word t) {
1375318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover    r_info = ((Elf64_Xword)s << 32) + (t&0xffffffffL);
13761461520f8cba8ebbdfd832d5396079888f1ab96eDouglas Gregor  }
1377004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming};
1378004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
1379004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming// Relocation entry with explicit addend.
1380004c82ad7c0d2da761726f063373c28ffd18e66dMatt Flemingstruct Elf64_Rela {
1381004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  Elf64_Addr  r_offset; // Location (file byte offset, or program virtual addr).
1382004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  Elf64_Xword  r_info;   // Symbol table index and type of relocation to apply.
1383004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  Elf64_Sxword r_addend; // Compute value for relocatable field by adding this.
1384004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
1385004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,
1386004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  // and ELF64_R_INFO macros defined in the ELF specification:
1387318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  Elf64_Word getSymbol() const { return (r_info >> 32); }
1388318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  Elf64_Word getType() const {
1389318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover    return (Elf64_Word) (r_info & 0xffffffffL);
1390004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  }
1391318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setSymbol(Elf64_Word s) { setSymbolAndType(s, getType()); }
1392318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setType(Elf64_Word t) { setSymbolAndType(getSymbol(), t); }
1393318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover  void setSymbolAndType(Elf64_Word s, Elf64_Word t) {
1394318b2cc86faeec1edd330eabba6cfcaab36e3facTim Northover    r_info = ((Elf64_Xword)s << 32) + (t&0xffffffffL);
13951461520f8cba8ebbdfd832d5396079888f1ab96eDouglas Gregor  }
1396004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming};
1397004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
13989a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Program header for ELF32.
13996c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Phdr {
14006c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word p_type;   // Type of segment
14016c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off  p_offset; // File offset where segment is located, in bytes
14026c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr p_vaddr;  // Virtual address of beginning of segment
14036c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr p_paddr;  // Physical address of beginning of segment (OS-specific)
14046c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word p_filesz; // Num. of bytes in file image of segment (may be zero)
14056c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word p_memsz;  // Num. of bytes in mem image of segment (may be zero)
14066c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word p_flags;  // Segment flags
14076c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word p_align;  // Segment alignment constraint
14086c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
14096c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
14109a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Program header for ELF64.
14119a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonstruct Elf64_Phdr {
14129a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Word   p_type;   // Type of segment
14139a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Word   p_flags;  // Segment flags
14149a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Off    p_offset; // File offset where segment is located, in bytes
14159a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Addr   p_vaddr;  // Virtual address of beginning of segment
1416dc08bfbd565ba6540be698bba551b2039661299dJack Carter  Elf64_Addr   p_paddr;  // Physical addr of beginning of segment (OS-specific)
14179a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Xword  p_filesz; // Num. of bytes in file image of segment (may be zero)
14189a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Xword  p_memsz;  // Num. of bytes in mem image of segment (may be zero)
14199a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Xword  p_align;  // Segment alignment constraint
14209a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
14219a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
14224e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov// Segment types.
14236c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
14246c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_NULL    = 0, // Unused segment.
14256c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_LOAD    = 1, // Loadable segment.
14266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_DYNAMIC = 2, // Dynamic linking information.
14276c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_INTERP  = 3, // Interpreter pathname.
14286c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_NOTE    = 4, // Auxiliary information.
14296c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_SHLIB   = 5, // Reserved.
14306c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  PT_PHDR    = 6, // The program header table itself.
1431fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PT_TLS     = 7, // The thread-local storage template.
1432fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PT_LOOS    = 0x60000000, // Lowest operating system-specific pt entry type.
1433296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  PT_HIOS    = 0x6fffffff, // Highest operating system-specific pt entry type.
1434296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  PT_LOPROC  = 0x70000000, // Lowest processor-specific program hdr entry type.
1435296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  PT_HIPROC  = 0x7fffffff, // Highest processor-specific program hdr entry type.
1436fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
1437fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // x86-64 program header types.
1438fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  // These all contain stack unwind tables.
1439fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PT_GNU_EH_FRAME  = 0x6474e550,
1440fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PT_SUNW_EH_FRAME = 0x6474e550,
1441fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PT_SUNW_UNWIND   = 0x6464e550,
1442fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
14436aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  PT_GNU_STACK  = 0x6474e551, // Indicates stack executability.
14446aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  PT_GNU_RELRO  = 0x6474e552, // Read-only after relocation.
14456aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan
1446296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  // ARM program header types.
1447dc08bfbd565ba6540be698bba551b2039661299dJack Carter  PT_ARM_ARCHEXT = 0x70000000, // Platform architecture compatibility info
1448296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  // These all contain stack unwind tables.
1449296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  PT_ARM_EXIDX   = 0x70000001,
1450296815dccee4f5392855c829b8a9e4a661b83a42James Molloy  PT_ARM_UNWIND  = 0x70000001
14516c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
14526c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
14534e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov// Segment flag bits.
14544e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkovenum {
14554e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov  PF_X        = 1,         // Execute
14564e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov  PF_W        = 2,         // Write
14574e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov  PF_R        = 4,         // Read
1458fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PF_MASKOS   = 0x0ff00000,// Bits for operating system-specific semantics.
1459fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  PF_MASKPROC = 0xf0000000 // Bits for processor-specific semantics.
14604e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov};
14614e9ca339b56f082c6b2d7dd7d91f704801c0d4fdMikhail Glushenkov
14629a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Dynamic table entry for ELF32.
14639a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonstruct Elf32_Dyn
14649a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson{
14659a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf32_Sword d_tag;            // Type of dynamic table entry.
14669a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  union
14679a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  {
14689a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson      Elf32_Word d_val;         // Integer value of entry.
14699a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson      Elf32_Addr d_ptr;         // Pointer value of entry.
14709a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  } d_un;
14719a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
14729a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
14739a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Dynamic table entry for ELF64.
14749a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonstruct Elf64_Dyn
14759a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson{
14769a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  Elf64_Sxword d_tag;           // Type of dynamic table entry.
14779a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  union
14789a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  {
14799a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson      Elf64_Xword d_val;        // Integer value of entry.
14809a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson      Elf64_Addr  d_ptr;        // Pointer value of entry.
14819a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  } d_un;
14829a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
14839a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
14849a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// Dynamic table entry tags.
14859a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonenum {
14869a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_NULL         = 0,        // Marks end of dynamic array.
14879a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_NEEDED       = 1,        // String table offset of needed library.
14889a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_PLTRELSZ     = 2,        // Size of relocation entries in PLT.
14899a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_PLTGOT       = 3,        // Address associated with linkage table.
14909a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_HASH         = 4,        // Address of symbolic hash table.
14919a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_STRTAB       = 5,        // Address of dynamic string table.
14929a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_SYMTAB       = 6,        // Address of dynamic symbol table.
14939a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RELA         = 7,        // Address of relocation table (Rela entries).
14949a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RELASZ       = 8,        // Size of Rela relocation table.
14959a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RELAENT      = 9,        // Size of a Rela relocation entry.
14969a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_STRSZ        = 10,       // Total size of the string table.
14979a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_SYMENT       = 11,       // Size of a symbol table entry.
14989a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_INIT         = 12,       // Address of initialization function.
14999a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_FINI         = 13,       // Address of termination function.
15009a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_SONAME       = 14,       // String table offset of a shared objects name.
15019a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RPATH        = 15,       // String table offset of library search path.
15029a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_SYMBOLIC     = 16,       // Changes symbol resolution algorithm.
15039a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_REL          = 17,       // Address of relocation table (Rel entries).
15049a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RELSZ        = 18,       // Size of Rel relocation table.
15059a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_RELENT       = 19,       // Size of a Rel relocation entry.
15069a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_PLTREL       = 20,       // Type of relocation entry used for linking.
15079a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_DEBUG        = 21,       // Reserved for debugger.
1508cbda61a468b4a2b33a54781d65023da7d9c8d291Michael J. Spencer  DT_TEXTREL      = 22,       // Relocations exist for non-writable segments.
15099a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_JMPREL       = 23,       // Address of relocations associated with PLT.
15109a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_BIND_NOW     = 24,       // Process all relocations before execution.
15119a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_INIT_ARRAY   = 25,       // Pointer to array of initialization functions.
15129a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_FINI_ARRAY   = 26,       // Pointer to array of termination functions.
15139a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_INIT_ARRAYSZ = 27,       // Size of DT_INIT_ARRAY.
15149a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_FINI_ARRAYSZ = 28,       // Size of DT_FINI_ARRAY.
1515fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DT_RUNPATH      = 29,       // String table offset of lib search path.
1516fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DT_FLAGS        = 30,       // Flags.
1517fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DT_ENCODING     = 32,       // Values from here to DT_LOOS follow the rules
1518fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                              // for the interpretation of the d_un union.
1519fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
1520fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DT_PREINIT_ARRAY = 32,      // Pointer to array of preinit functions.
1521fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DT_PREINIT_ARRAYSZ = 33,    // Size of the DT_PREINIT_ARRAY array.
1522fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
15239a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_LOOS         = 0x60000000, // Start of environment specific tags.
15249a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_HIOS         = 0x6FFFFFFF, // End of environment specific tags.
15259a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  DT_LOPROC       = 0x70000000, // Start of processor specific tags.
15266aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_HIPROC       = 0x7FFFFFFF, // End of processor specific tags.
15276aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan
15286aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_RELACOUNT    = 0x6FFFFFF9, // ELF32_Rela count.
15296aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_RELCOUNT     = 0x6FFFFFFA, // ELF32_Rel count.
15306aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan
15316aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_FLAGS_1      = 0X6FFFFFFB, // Flags_1.
15326aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_VERDEF       = 0X6FFFFFFC, // The address of the version definition table.
15336aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_VERDEFNUM    = 0X6FFFFFFD, // The number of entries in DT_VERDEF.
15346aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DT_VERNEED      = 0X6FFFFFFE, // The address of the version Dependency table.
1535e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_VERNEEDNUM   = 0X6FFFFFFF, // The number of entries in DT_VERNEED.
1536e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan
1537e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  // Mips specific dynamic table entry tags.
1538e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_RLD_VERSION   = 0x70000001, // 32 bit version number for runtime
1539e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // linker interface.
1540e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_TIME_STAMP    = 0x70000002, // Time stamp.
1541e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_ICHECKSUM     = 0x70000003, // Checksum of external strings
1542e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // and common sizes.
1543e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_IVERSION      = 0x70000004, // Index of version string
1544e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in string table.
1545e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_FLAGS         = 0x70000005, // 32 bits of flags.
1546e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_BASE_ADDRESS  = 0x70000006, // Base address of the segment.
1547e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_MSYM          = 0x70000007, // Address of .msym section.
1548e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_CONFLICT      = 0x70000008, // Address of .conflict section.
1549e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_LIBLIST       = 0x70000009, // Address of .liblist section.
1550e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_LOCAL_GOTNO   = 0x7000000a, // Number of local global offset
1551e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // table entries.
1552e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_CONFLICTNO    = 0x7000000b, // Number of entries
1553e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in the .conflict section.
1554e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_LIBLISTNO     = 0x70000010, // Number of entries
1555e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in the .liblist section.
1556e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_SYMTABNO      = 0x70000011, // Number of entries
1557e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in the .dynsym section.
1558e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_UNREFEXTNO    = 0x70000012, // Index of first external dynamic symbol
1559e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // not referenced locally.
1560e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_GOTSYM        = 0x70000013, // Index of first dynamic symbol
1561e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in global offset table.
1562e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_HIPAGENO      = 0x70000014, // Number of page table entries
1563e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // in global offset table.
1564e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_RLD_MAP       = 0x70000016, // Address of run time loader map,
1565e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                      // used for debugging.
1566e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_CLASS       = 0x70000017, // Delta C++ class definition.
1567e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_CLASS_NO    = 0x70000018, // Number of entries
1568e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // in DT_MIPS_DELTA_CLASS.
1569e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_INSTANCE    = 0x70000019, // Delta C++ class instances.
1570e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_INSTANCE_NO = 0x7000001A, // Number of entries
1571e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // in DT_MIPS_DELTA_INSTANCE.
1572e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_RELOC       = 0x7000001B, // Delta relocations.
1573e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_RELOC_NO    = 0x7000001C, // Number of entries
1574e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // in DT_MIPS_DELTA_RELOC.
1575e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_SYM         = 0x7000001D, // Delta symbols that Delta
1576e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // relocations refer to.
1577e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_SYM_NO      = 0x7000001E, // Number of entries
1578e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // in DT_MIPS_DELTA_SYM.
1579e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_CLASSSYM    = 0x70000020, // Delta symbols that hold
1580e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // class declarations.
1581e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021, // Number of entries
1582e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // in DT_MIPS_DELTA_CLASSSYM.
1583e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_CXX_FLAGS         = 0x70000022, // Flags indicating information
1584e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // about C++ flavor.
1585e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_PIXIE_INIT        = 0x70000023, // Pixie information.
1586e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_SYMBOL_LIB        = 0x70000024, // Address of .MIPS.symlib
1587e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_LOCALPAGE_GOTIDX  = 0x70000025, // The GOT index of the first PTE
1588e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // for a segment
1589e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_LOCAL_GOTIDX      = 0x70000026, // The GOT index of the first PTE
1590e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // for a local symbol
1591e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_HIDDEN_GOTIDX     = 0x70000027, // The GOT index of the first PTE
1592e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // for a hidden symbol
1593e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_PROTECTED_GOTIDX  = 0x70000028, // The GOT index of the first PTE
1594e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // for a protected symbol
1595e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_OPTIONS           = 0x70000029, // Address of `.MIPS.options'.
1596e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_INTERFACE         = 0x7000002A, // Address of `.interface'.
1597e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_DYNSTR_ALIGN      = 0x7000002B, // Unknown.
1598e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_INTERFACE_SIZE    = 0x7000002C, // Size of the .interface section.
1599e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002D, // Size of rld_text_resolve
1600e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                              // function stored in the GOT.
1601e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_PERF_SUFFIX       = 0x7000002E, // Default suffix of DSO to be added
1602e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // by rld on dlopen() calls.
1603e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_COMPACT_SIZE      = 0x7000002F, // Size of compact relocation
1604e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // section (O32).
1605e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_GP_VALUE          = 0x70000030, // GP value for auxiliary GOTs.
1606e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_AUX_DYNAMIC       = 0x70000031, // Address of auxiliary .dynamic.
1607e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_PLTGOT            = 0x70000032, // Address of the base of the PLTGOT.
1608e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  DT_MIPS_RWPLT             = 0x70000034  // Points to the base
1609e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                          // of a writable PLT.
16109a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
16119a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
1612fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer// DT_FLAGS values.
1613fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencerenum {
1614fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DF_ORIGIN     = 0x01, // The object may reference $ORIGIN.
1615fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DF_SYMBOLIC   = 0x02, // Search the shared lib before searching the exe.
1616fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DF_TEXTREL    = 0x04, // Relocations may modify a non-writable segment.
1617fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DF_BIND_NOW   = 0x08, // Process all relocations on load.
1618fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  DF_STATIC_TLS = 0x10  // Reject attempts to load dynamically.
1619fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer};
1620fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer
16216aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan// State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 entry.
16226aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyanenum {
16236aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_NOW        = 0x00000001, // Set RTLD_NOW for this object.
16246aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_GLOBAL     = 0x00000002, // Set RTLD_GLOBAL for this object.
16256aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_GROUP      = 0x00000004, // Set RTLD_GROUP for this object.
16266aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_NODELETE   = 0x00000008, // Set RTLD_NODELETE for this object.
16276aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_LOADFLTR   = 0x00000010, // Trigger filtee loading at runtime.
16286aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_INITFIRST  = 0x00000020, // Set RTLD_INITFIRST for this object.
16296aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_NOOPEN     = 0x00000040, // Set RTLD_NOOPEN for this object.
16306aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_ORIGIN     = 0x00000080, // $ORIGIN must be handled.
16316aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_DIRECT     = 0x00000100, // Direct binding enabled.
16326aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_TRANS      = 0x00000200,
16336aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_INTERPOSE  = 0x00000400, // Object is used to interpose.
16346aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_NODEFLIB   = 0x00000800, // Ignore default lib search path.
16356aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_NODUMP     = 0x00001000, // Object can't be dldump'ed.
16366aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_CONFALT    = 0x00002000, // Configuration alternative created.
16376aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_ENDFILTEE  = 0x00004000, // Filtee terminates filters search.
16386aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_DISPRELDNE = 0x00008000, // Disp reloc applied at build time.
16396aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan  DF_1_DISPRELPND = 0x00010000  // Disp reloc applied at run-time.
16406aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan};
16416aef977e85d5ff2ae1f8b78a62db0762e82595a5Simon Atanasyan
1642e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan// DT_MIPS_FLAGS values.
1643e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyanenum {
1644e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_NONE                    = 0x00000000, // No flags.
1645e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_QUICKSTART              = 0x00000001, // Uses shortcut pointers.
1646e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_NOTPOT                  = 0x00000002, // Hash size is not a power of two.
1647e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHS_NO_LIBRARY_REPLACEMENT  = 0x00000004, // Ignore LD_LIBRARY_PATH.
1648e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_NO_MOVE                 = 0x00000008, // DSO address may not be relocated.
1649e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_SGI_ONLY                = 0x00000010, // SGI specific features.
1650e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_GUARANTEE_INIT          = 0x00000020, // Guarantee that .init will finish
1651e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                            // executing before any non-init
1652e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                            // code in DSO is called.
1653e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_DELTA_C_PLUS_PLUS       = 0x00000040, // Contains Delta C++ code.
1654e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_GUARANTEE_START_INIT    = 0x00000080, // Guarantee that .init will start
1655e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                            // executing before any non-init
1656e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                            // code in DSO is called.
1657e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_PIXIE                   = 0x00000100, // Generated by pixie.
1658e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_DEFAULT_DELAY_LOAD      = 0x00000200, // Delay-load DSO by default.
1659e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_REQUICKSTART            = 0x00000400, // Object may be requickstarted
1660e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_REQUICKSTARTED          = 0x00000800, // Object has been requickstarted
1661e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_CORD                    = 0x00001000, // Generated by cord.
1662e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_NO_UNRES_UNDEF          = 0x00002000, // Object contains no unresolved
1663e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan                                            // undef symbols.
1664e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan  RHF_RLD_ORDER_SAFE          = 0x00004000  // Symbol table is in a safe order.
1665e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan};
1666e4ee452576449d79db4e82b9e5dd08c732327e71Simon Atanasyan
16672d70e263c2b508bf4641273dd89a23149f6f6164David Meyer// ElfXX_VerDef structure version (GNU versioning)
16682d70e263c2b508bf4641273dd89a23149f6f6164David Meyerenum {
16692d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_DEF_NONE    = 0,
16702d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_DEF_CURRENT = 1
16712d70e263c2b508bf4641273dd89a23149f6f6164David Meyer};
16722d70e263c2b508bf4641273dd89a23149f6f6164David Meyer
16732d70e263c2b508bf4641273dd89a23149f6f6164David Meyer// VerDef Flags (ElfXX_VerDef::vd_flags)
16742d70e263c2b508bf4641273dd89a23149f6f6164David Meyerenum {
16752d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_FLG_BASE = 0x1,
16762d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_FLG_WEAK = 0x2,
16772d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_FLG_INFO = 0x4
16782d70e263c2b508bf4641273dd89a23149f6f6164David Meyer};
16792d70e263c2b508bf4641273dd89a23149f6f6164David Meyer
16802d70e263c2b508bf4641273dd89a23149f6f6164David Meyer// Special constants for the version table. (SHT_GNU_versym/.gnu.version)
16812d70e263c2b508bf4641273dd89a23149f6f6164David Meyerenum {
16822d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_NDX_LOCAL  = 0,      // Unversioned local symbol
16832d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_NDX_GLOBAL = 1,      // Unversioned global symbol
16842d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VERSYM_VERSION = 0x7fff, // Version Index mask
16852d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VERSYM_HIDDEN  = 0x8000  // Hidden bit (non-default version)
16862d70e263c2b508bf4641273dd89a23149f6f6164David Meyer};
16872d70e263c2b508bf4641273dd89a23149f6f6164David Meyer
16882d70e263c2b508bf4641273dd89a23149f6f6164David Meyer// ElfXX_VerNeed structure version (GNU versioning)
16892d70e263c2b508bf4641273dd89a23149f6f6164David Meyerenum {
16902d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_NEED_NONE = 0,
16912d70e263c2b508bf4641273dd89a23149f6f6164David Meyer  VER_NEED_CURRENT = 1
16922d70e263c2b508bf4641273dd89a23149f6f6164David Meyer};
16932d70e263c2b508bf4641273dd89a23149f6f6164David Meyer
16946c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke} // end namespace ELF
16956c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
16966c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke} // end namespace llvm
1697551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer
1698551ccae044b0ff658fe629dd67edd5ffe75d10e8Reid Spencer#endif
1699