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
235e4d8a5eca03c977ba01e061078a2d740ee6130aZonr Chang#include "llvm/Support/Compiler.h"
241f6efa3996dd1929fbc129203ce5009b620e6969Michael J. Spencer#include "llvm/Support/DataTypes.h"
256c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke#include <cstring>
266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
276c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekenamespace llvm {
286c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
296c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekenamespace ELF {
306c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
316c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Addr; // Program address
326c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Off;  // File offset
33c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef uint16_t Elf32_Half;
346c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeketypedef uint32_t Elf32_Word;
35c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int32_t  Elf32_Sword;
366c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
37620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Addr;
38620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Off;
39c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef uint16_t Elf64_Half;
40620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint32_t Elf64_Word;
41c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int32_t  Elf64_Sword;
42620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeketypedef uint64_t Elf64_Xword;
43c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencertypedef int64_t  Elf64_Sxword;
44620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke
456c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file magic string.
46757c1f9d87b516a1e3bc4cd678245b207ae9c559Brian Gaekestatic const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\0' };
476c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
489a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson// e_ident size and indices.
499a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilsonenum {
509a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG0       = 0,          // File identification index.
519a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG1       = 1,          // File identification index.
529a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG2       = 2,          // File identification index.
539a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_MAG3       = 3,          // File identification index.
549a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_CLASS      = 4,          // File class.
559a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_DATA       = 5,          // Data encoding.
569a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_VERSION    = 6,          // File version.
579a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_OSABI      = 7,          // OS/ABI identification.
589a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_ABIVERSION = 8,          // ABI version.
599a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_PAD        = 9,          // Start of padding bytes.
609a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  EI_NIDENT     = 16          // Number of bytes in e_ident.
619a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson};
629a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson
636c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekestruct Elf32_Ehdr {
649a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes
656c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_type;      // Type of file (see ET_* below)
666c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_machine;   // Required architecture for this file (see EM_*)
676c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    e_version;   // Must be equal to 1
686c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Addr    e_entry;     // Address to jump to in order to start program
696c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off     e_phoff;     // Program header table's file offset, in bytes
706c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Off     e_shoff;     // Section header table's file offset, in bytes
716c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Word    e_flags;     // Processor-specific flags
726c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_ehsize;    // Size of ELF header, in bytes
736c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_phentsize; // Size of an entry in the program header table
746c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_phnum;     // Number of entries in the program header table
756c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shentsize; // Size of an entry in the section header table
766c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shnum;     // Number of entries in the section header table
776c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  Elf32_Half    e_shstrndx;  // Sect hdr table index of sect name string table
78fe4591bfc2b147c10d6a7b1a5af56454fb78daceStephen Wilson  bool checkMagic() const {
79314451326ad1ef89241b240a704e104897e4ee81Stephen Wilson    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
806c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  }
819a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }
829a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }
836c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
846c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
85620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke// 64-bit ELF header. Fields are the same as for ELF32, but with different
86620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke// types (see above).
87e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaekestruct Elf64_Ehdr {
889a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char e_ident[EI_NIDENT];
89c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_type;
90c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_machine;
91c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word    e_version;
92620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Addr    e_entry;
93620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Off     e_phoff;
94620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke  Elf64_Off     e_shoff;
95c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Word    e_flags;
96c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_ehsize;
97c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_phentsize;
98c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_phnum;
99c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shentsize;
100c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shnum;
101c8f6c44af46554036084cba21a118266f5e26c0eMichael J. Spencer  Elf64_Half    e_shstrndx;
1029a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  bool checkMagic() const {
1039a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;
1049a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  }
1059a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }
1069a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }
107e9f6f2c0492af8097166f1b7d62f131f20ca5714Brian Gaeke};
108620ee02353d8b65959dc01a66b073adfcdef9eacBrian Gaeke
1096c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// File types
1106c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
1116c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_NONE   = 0,      // No file type
1126c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_REL    = 1,      // Relocatable file
1136c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_EXEC   = 2,      // Executable file
1146c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_DYN    = 3,      // Shared object file
1156c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_CORE   = 4,      // Core file
1166c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_LOPROC = 0xff00, // Beginning of processor-specific codes
1176c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ET_HIPROC = 0xffff  // Processor-specific
1186c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
1196c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
1205af8f421b6412e52530608097e39d2602195629fDan Gohman// Versioning
1215af8f421b6412e52530608097e39d2602195629fDan Gohmanenum {
1225af8f421b6412e52530608097e39d2602195629fDan Gohman  EV_NONE = 0,
1235af8f421b6412e52530608097e39d2602195629fDan Gohman  EV_CURRENT = 1
1245af8f421b6412e52530608097e39d2602195629fDan Gohman};
1255af8f421b6412e52530608097e39d2602195629fDan Gohman
1266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Machine architectures
127cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines// See current registered ELF machine architectures at:
128cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines//    http://www.uxsglobal.com/developers/gabi/latest/ch4.eheader.html
1296c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
130fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NONE          = 0, // No machine
131fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32           = 1, // AT&T WE 32100
132fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARC         = 2, // SPARC
133fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_386           = 3, // Intel 386
134fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68K           = 4, // Motorola 68000
135fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_88K           = 5, // Motorola 88000
136fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_486           = 6, // Intel 486 (deprecated)
137fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_860           = 7, // Intel 80860
138fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS          = 8, // MIPS R3000
139fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_S370          = 9, // IBM System/370
140fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS_RS3_LE   = 10, // MIPS RS3000 Little-endian
141fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PARISC        = 15, // Hewlett-Packard PA-RISC
142fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VPP500        = 17, // Fujitsu VPP500
143fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARC32PLUS   = 18, // Enhanced instruction set SPARC
144fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_960           = 19, // Intel 80960
145fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PPC           = 20, // PowerPC
146fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PPC64         = 21, // PowerPC64
147fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_S390          = 22, // IBM System/390
148fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPU           = 23, // IBM SPU/SPC
149fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_V800          = 36, // NEC V800
150fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FR20          = 37, // Fujitsu FR20
151fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RH32          = 38, // TRW RH-32
152fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RCE           = 39, // Motorola RCE
153fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARM           = 40, // ARM
154fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ALPHA         = 41, // DEC Alpha
155fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SH            = 42, // Hitachi SH
156fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SPARCV9       = 43, // SPARC V9
157fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TRICORE       = 44, // Siemens TriCore
158fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC           = 45, // Argonaut RISC Core
159fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_300        = 46, // Hitachi H8/300
160fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_300H       = 47, // Hitachi H8/300H
161fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8S           = 48, // Hitachi H8S
162fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_H8_500        = 49, // Hitachi H8/500
163fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_IA_64         = 50, // Intel IA-64 processor architecture
164fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MIPS_X        = 51, // Stanford MIPS-X
165fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COLDFIRE      = 52, // Motorola ColdFire
166fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC12        = 53, // Motorola M68HC12
167fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMA           = 54, // Fujitsu MMA Multimedia Accelerator
168fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PCP           = 55, // Siemens PCP
169fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NCPU          = 56, // Sony nCPU embedded RISC processor
170fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NDR1          = 57, // Denso NDR1 microprocessor
171fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STARCORE      = 58, // Motorola Star*Core processor
172fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ME16          = 59, // Toyota ME16 processor
173fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST100         = 60, // STMicroelectronics ST100 processor
174fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TINYJ         = 61, // Advanced Logic Corp. TinyJ embedded processor family
175fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_X86_64        = 62, // AMD x86-64 architecture
176fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDSP          = 63, // Sony DSP Processor
177fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDP10         = 64, // Digital Equipment Corp. PDP-10
178fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PDP11         = 65, // Digital Equipment Corp. PDP-11
179fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FX66          = 66, // Siemens FX66 microcontroller
180fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST9PLUS       = 67, // STMicroelectronics ST9+ 8/16 bit microcontroller
181fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST7           = 68, // STMicroelectronics ST7 8-bit microcontroller
182fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC16        = 69, // Motorola MC68HC16 Microcontroller
183fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC11        = 70, // Motorola MC68HC11 Microcontroller
184fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC08        = 71, // Motorola MC68HC08 Microcontroller
185fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_68HC05        = 72, // Motorola MC68HC05 Microcontroller
186fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SVX           = 73, // Silicon Graphics SVx
187fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST19          = 74, // STMicroelectronics ST19 8-bit microcontroller
188fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VAX           = 75, // Digital VAX
189fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRIS          = 76, // Axis Communications 32-bit embedded processor
190fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_JAVELIN       = 77, // Infineon Technologies 32-bit embedded processor
191fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FIREPATH      = 78, // Element 14 64-bit DSP Processor
192fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ZSP           = 79, // LSI Logic 16-bit DSP Processor
193fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMIX          = 80, // Donald Knuth's educational 64-bit processor
194fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_HUANY         = 81, // Harvard University machine-independent object files
195fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PRISM         = 82, // SiTera Prism
196fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_AVR           = 83, // Atmel AVR 8-bit microcontroller
197fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_FR30          = 84, // Fujitsu FR30
198fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_D10V          = 85, // Mitsubishi D10V
199fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_D30V          = 86, // Mitsubishi D30V
200fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_V850          = 87, // NEC v850
201fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32R          = 88, // Mitsubishi M32R
202fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MN10300       = 89, // Matsushita MN10300
203fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MN10200       = 90, // Matsushita MN10200
204fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_PJ            = 91, // picoJava
205fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_OPENRISC      = 92, // OpenRISC 32-bit embedded processor
206fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC_COMPACT   = 93, // ARC International ARCompact processor (old
207fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                         // spelling/synonym: EM_ARC_A5)
208fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XTENSA        = 94, // Tensilica Xtensa Architecture
209fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE     = 95, // Alphamosaic VideoCore processor
210fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TMM_GPP       = 96, // Thompson Multimedia General Purpose Processor
211fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NS32K         = 97, // National Semiconductor 32000 series
212fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TPC           = 98, // Tenor Network TPC processor
213fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SNP1K         = 99, // Trebia SNP 1000 processor
214fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ST200         = 100, // STMicroelectronics (www.st.com) ST200
215fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_IP2K          = 101, // Ubicom IP2xxx microcontroller family
216fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MAX           = 102, // MAX Processor
217fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CR            = 103, // National Semiconductor CompactRISC microprocessor
218fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_F2MC16        = 104, // Fujitsu F2MC16
219fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MSP430        = 105, // Texas Instruments embedded microcontroller msp430
220fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_BLACKFIN      = 106, // Analog Devices Blackfin (DSP) processor
221fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SE_C33        = 107, // S1C33 Family of Seiko Epson processors
222fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SEP           = 108, // Sharp embedded microprocessor
223fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARCA          = 109, // Arca RISC Microprocessor
224fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_UNICORE       = 110, // Microprocessor series from PKU-Unity Ltd. and MPRC
225fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // of Peking University
226fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_EXCESS        = 111, // eXcess: 16/32/64-bit configurable embedded CPU
227fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DXP           = 112, // Icera Semiconductor Inc. Deep Execution Processor
228fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ALTERA_NIOS2  = 113, // Altera Nios II soft-core processor
229fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRX           = 114, // National Semiconductor CompactRISC CRX
230fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XGATE         = 115, // Motorola XGATE embedded processor
231fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_C166          = 116, // Infineon C16x/XC16x processor
232fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M16C          = 117, // Renesas M16C series microprocessors
233fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DSPIC30F      = 118, // Microchip Technology dsPIC30F Digital Signal
234fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // Controller
235fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CE            = 119, // Freescale Communication Engine RISC core
236fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_M32C          = 120, // Renesas M32C series microprocessors
237fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TSK3000       = 131, // Altium TSK3000 core
238fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RS08          = 132, // Freescale RS08 embedded processor
239fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SHARC         = 133, // Analog Devices SHARC family of 32-bit DSP
240fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // processors
241fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG2         = 134, // Cyan Technology eCOG2 microprocessor
242fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SCORE7        = 135, // Sunplus S+core7 RISC processor
243fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_DSP24         = 136, // New Japan Radio (NJR) 24-bit DSP Processor
244fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE3    = 137, // Broadcom VideoCore III processor
245fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_LATTICEMICO32 = 138, // RISC processor for Lattice FPGA architecture
246fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SE_C17        = 139, // Seiko Epson C17 family
247fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C6000      = 140, // The Texas Instruments TMS320C6000 DSP family
248fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C2000      = 141, // The Texas Instruments TMS320C2000 DSP family
249fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TI_C5500      = 142, // The Texas Instruments TMS320C55x DSP family
250fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MMDSP_PLUS    = 160, // STMicroelectronics 64bit VLIW Data Signal Processor
251fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CYPRESS_M8C   = 161, // Cypress M8C microprocessor
252fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_R32C          = 162, // Renesas R32C series microprocessors
253fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TRIMEDIA      = 163, // NXP Semiconductors TriMedia architecture family
25468ef0382e4efe4a4c06e47a53a275b873ba0cff4Evandro Menezes  EM_HEXAGON       = 164, // Qualcomm Hexagon processor
255fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_8051          = 165, // Intel 8051 and variants
256fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STXP7X        = 166, // STMicroelectronics STxP7x family of configurable
257fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // and extensible RISC processors
258fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_NDS32         = 167, // Andes Technology compact code size embedded RISC
259fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // processor family
260fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG1         = 168, // Cyan Technology eCOG1X family
261fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG1X        = 168, // Cyan Technology eCOG1X family
262fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MAXQ30        = 169, // Dallas Semiconductor MAXQ30 Core Micro-controllers
263fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_XIMO16        = 170, // New Japan Radio (NJR) 16-bit DSP Processor
264fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MANIK         = 171, // M2000 Reconfigurable RISC Microprocessor
265fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CRAYNV2       = 172, // Cray Inc. NV2 vector architecture
266fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RX            = 173, // Renesas RX family
267fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_METAG         = 174, // Imagination Technologies META processor
268fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // architecture
269fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_MCST_ELBRUS   = 175, // MCST Elbrus general purpose hardware architecture
270fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ECOG16        = 176, // Cyan Technology eCOG16 family
271fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CR16          = 177, // National Semiconductor CompactRISC CR16 16-bit
272fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer                          // microprocessor
273fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ETPU          = 178, // Freescale Extended Time Processing Unit
274fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_SLE9X         = 179, // Infineon Technologies SLE9X core
275fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_L10M          = 180, // Intel L10M
276fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_K10M          = 181, // Intel K10M
27772062f5744557e270a38192554c3126ea5f97434Tim Northover  EM_AARCH64       = 183, // ARM AArch64
278fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_AVR32         = 185, // Atmel Corporation 32-bit microprocessor family
279fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_STM8          = 186, // STMicroeletronics STM8 8-bit microcontroller
280fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILE64        = 187, // Tilera TILE64 multicore architecture family
281fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILEPRO       = 188, // Tilera TILEPro multicore architecture family
282fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CUDA          = 190, // NVIDIA CUDA architecture
283fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_TILEGX        = 191, // Tilera TILE-Gx multicore architecture family
284fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_CLOUDSHIELD   = 192, // CloudShield architecture family
285fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COREA_1ST     = 193, // KIPO-KAIST Core-A 1st generation processor family
286fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_COREA_2ND     = 194, // KIPO-KAIST Core-A 2nd generation processor family
287fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_ARC_COMPACT2  = 195, // Synopsys ARCompact V2
288fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_OPEN8         = 196, // Open8 8-bit RISC soft processor core
289fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_RL78          = 197, // Renesas RL78 family
290fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_VIDEOCORE5    = 198, // Broadcom VideoCore V processor
291fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  EM_78KOR         = 199, // Renesas 78KOR family
292cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_56800EX       = 200, // Freescale 56800EX Digital Signal Controller (DSC)
293cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_BA1           = 201, // Beyond BA1 CPU architecture
294cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_BA2           = 202, // Beyond BA2 CPU architecture
295cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_XCORE         = 203, // XMOS xCORE processor family
296cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_MCHP_PIC      = 204, // Microchip 8-bit PIC(r) family
297cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_INTEL205      = 205, // Reserved by Intel
298cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_INTEL206      = 206, // Reserved by Intel
299cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_INTEL207      = 207, // Reserved by Intel
300cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_INTEL208      = 208, // Reserved by Intel
301cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_INTEL209      = 209, // Reserved by Intel
302cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_KM32          = 210, // KM211 KM32 32-bit processor
303cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_KMX32         = 211, // KM211 KMX32 32-bit processor
304cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_KMX16         = 212, // KM211 KMX16 16-bit processor
305cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_KMX8          = 213, // KM211 KMX8 8-bit processor
306cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_KVARC         = 214, // KM211 KVARC processor
307cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_CDP           = 215, // Paneve CDP architecture family
308cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_COGE          = 216, // Cognitive Smart Memory Processor
309cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_COOL          = 217, // iCelero CoolEngine
310cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_NORC          = 218, // Nanoradio Optimized RISC
311cd81d94322a39503e4a3e87b6ee03d4fcb3465fbStephen Hines  EM_CSR_KALIMBA   = 219  // CSR Kalimba architecture family
3126c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
3136c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
3146c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file classes.
3156c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
316b84551a14f1c96942eb82408652e633543b0961eMichael J. Spencer  ELFCLASSNONE = 0,
3176c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFCLASS32 = 1, // 32-bit object file
3186c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFCLASS64 = 2  // 64-bit object file
3196c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
3206c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
3216c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke// Object file byte orderings.
3226c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaekeenum {
3239a9ad77847c1be4ffc5ba6304e33ccecbf72e43fStephen Wilson  ELFDATANONE = 0, // Invalid data encoding.
3246c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFDATA2LSB = 1, // Little-endian object file
3256c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke  ELFDATA2MSB = 2  // Big-endian object file
3266c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke};
3276c39a42b5c93b6d0af008dbafed6134d1deaa848Brian Gaeke
328e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming// OS ABI identification.
3295af8f421b6412e52530608097e39d2602195629fDan Gohmanenum {
330e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NONE = 0,          // UNIX System V ABI
331e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_HPUX = 1,          // HP-UX operating system
332e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NETBSD = 2,        // NetBSD
333d56d756611173394e4ec937601ab825280fc2577Sean Silva  ELFOSABI_GNU = 3,           // GNU/Linux
334d56d756611173394e4ec937601ab825280fc2577Sean Silva  ELFOSABI_LINUX = 3,         // Historical alias for ELFOSABI_GNU.
335e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_HURD = 4,          // GNU/Hurd
336e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_SOLARIS = 6,       // Solaris
337e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_AIX = 7,           // AIX
338e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_IRIX = 8,          // IRIX
339e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_FREEBSD = 9,       // FreeBSD
340e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_TRU64 = 10,        // TRU64 UNIX
341e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_MODESTO = 11,      // Novell Modesto
342e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_OPENBSD = 12,      // OpenBSD
343e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_OPENVMS = 13,      // OpenVMS
344e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_NSK = 14,          // Hewlett-Packard Non-Stop Kernel
345e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_AROS = 15,         // AROS
346e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_FENIXOS = 16,      // FenixOS
347e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000
348e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_C6000_LINUX = 65,  // Linux TMS320C6000
349e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_ARM = 97,          // ARM
350e07cc5dab102c0f8c3f66c2703c95e547d6bf1c6Matt Fleming  ELFOSABI_STANDALONE = 255   // Standalone (embedded) application
3515af8f421b6412e52530608097e39d2602195629fDan Gohman};
3525af8f421b6412e52530608097e39d2602195629fDan Gohman
353004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming// X86_64 relocations.
354004c82ad7c0d2da761726f063373c28ffd18e66dMatt Flemingenum {
355004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_NONE       = 0,
356004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_64         = 1,
357004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC32       = 2,
358004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOT32      = 3,
359004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PLT32      = 4,
360004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_COPY       = 5,
361004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GLOB_DAT   = 6,
362004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_JUMP_SLOT  = 7,
363004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_RELATIVE   = 8,
364004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPCREL   = 9,
365004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_32         = 10,
366004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_32S        = 11,
367004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_16         = 12,
368004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC16       = 13,
369004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_8          = 14,
370004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC8        = 15,
371004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPMOD64   = 16,
372004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPOFF64   = 17,
373004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TPOFF64    = 18,
374004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSGD      = 19,
375004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSLD      = 20,
376004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_DTPOFF32   = 21,
377004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTTPOFF   = 22,
378004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TPOFF32    = 23,
379004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_PC64       = 24,
380004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTOFF64   = 25,
381004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPC32    = 26,
382fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOT64      = 27,
383fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPCREL64 = 28,
384fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPC64    = 29,
385fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_GOTPLT64   = 30,
386fc61a23506fdad8f38e3437d741a4108339abcfeMichael J. Spencer  R_X86_64_PLTOFF64   = 31,
387004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_SIZE32     = 32,
388004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_SIZE64     = 33,
389004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_GOTPC32_TLSDESC = 34,
390004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming  R_X86_64_TLSDESC_CALL    = 35,
391e35badad221354a53bc07a523120ed82d93e0569Michael J. Spencer  R_X86_64_TLSDESC    = 36,
392e35badad221354a53bc07a523120ed82d93e0569Michael J. Spencer  R_X86_64_IRELATIVE  = 37
393004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming};
394004c82ad7c0d2da761726f063373c28ffd18e66dMatt Fleming
395e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer// i386 relocations.
396e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer// TODO: this is just a subset
397e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramerenum {
398e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_NONE          = 0,
399e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_32            = 1,
400e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PC32          = 2,
401e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOT32         = 3,
402e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PLT32         = 4,
403e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_COPY          = 5,
404e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GLOB_DAT      = 6,
405e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_JUMP_SLOT     = 7,
406e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_RELATIVE      = 8,
407e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOTOFF        = 9,
408e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_GOTPC         = 10,
409e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_32PLT         = 11,
4103cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_TPOFF     = 14,
4113cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_IE        = 15,
4123cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GOTIE     = 16,
4133cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LE        = 17,
4143cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD        = 18,
4153cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM       = 19,
416e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_16            = 20,
417e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_PC16          = 21,
418e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer  R_386_8             = 22,
4193cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_PC8           = 23,
4203cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_32     = 24,
4213cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_PUSH   = 25,
4223cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_CALL   = 26,
4233cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GD_POP    = 27,
4243cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_32    = 28,
4253cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_PUSH  = 29,
4263cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_CALL  = 30,
4273cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDM_POP   = 31,
4283cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LDO_32    = 32,
4293cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_IE_32     = 33,
4303cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_LE_32     = 34,
4313cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DTPMOD32  = 35,
4323cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DTPOFF32  = 36,
4333cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_TPOFF32   = 37,
4343cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_GOTDESC   = 39,
4353cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DESC_CALL = 40,
4363cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_TLS_DESC      = 41,
4373cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_IRELATIVE     = 42,
4383cede2d0b2b6cc0a06f55da7c2f8e4263ec0091eRafael Espindola  R_386_NUM           = 43
439e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer};
440e5b57347e9485b59dd8d70f8f90d7794f473147aBenjamin Kramer
44110a431824831c1d57a62dd84346387238f516e0cRoman Divacky// ELF Relocation types for PPC32
4422c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divackyenum {
4432c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_NONE                  = 0,      /* No relocation. */
4442c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR32                = 1,
4452c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR24                = 2,
4462c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16                = 3,
4472c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_LO             = 4,
4482c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_HI             = 5,
4492c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR16_HA             = 6,
4502c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14                = 7,
4512c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14_BRTAKEN        = 8,
4522c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_ADDR14_BRNTAKEN       = 9,
4532c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL24                 = 10,
4542c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14                 = 11,
4552c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14_BRTAKEN         = 12,
4562c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky  R_PPC_REL14_BRNTAKEN        = 13,
4575de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16                 = 14,
4585de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_LO              = 15,
4595de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_HI              = 16,
4605de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC_GOT16_HA              = 17,
461ba6086818d9c5070061f74ac9944666b4312c6f0Ulrich Weigand  R_PPC_REL32                 = 26,
462bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLS                   = 67,
463228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_DTPMOD32              = 68,
464cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16               = 69,
465ba6086818d9c5070061f74ac9944666b4312c6f0Ulrich Weigand  R_PPC_TPREL16_LO            = 70,
466cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16_HI            = 71,
467cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_TPREL16_HA            = 72,
468228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_TPREL32               = 73,
469cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16              = 74,
470cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_LO           = 75,
471cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_HI           = 76,
472cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_DTPREL16_HA           = 77,
473228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC_DTPREL32              = 78,
474cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16           = 79,
475cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_LO        = 80,
476cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_HI        = 81,
477cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSGD16_HA        = 82,
478cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16           = 83,
479cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_LO        = 84,
480cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_HI        = 85,
481cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TLSLD16_HA        = 86,
482bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_TPREL16           = 87,
483bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_TPREL16_LO        = 88,
484cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TPREL16_HI        = 89,
485cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_TPREL16_HA        = 90,
486bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_DTPREL16          = 91,
487bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_GOT_DTPREL16_LO       = 92,
488cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC_GOT_DTPREL16_HI       = 93,
48984569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_GOT_DTPREL16_HA       = 94,
490bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLSGD                 = 95,
491bbeba2c20023c8bf6b34585fadf2abcc77ba8f32Ulrich Weigand  R_PPC_TLSLD                 = 96,
49284569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16                 = 249,
49384569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_LO              = 250,
49484569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_HI              = 251,
49584569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC_REL16_HA              = 252
4962c0d69fad0e658117922f3d96d9b732bedf9fd47Roman Divacky};
4972d7a53aec2c6426eba9e5dd6462cc9e86432b410Jason W Kim
49810a431824831c1d57a62dd84346387238f516e0cRoman Divacky// ELF Relocation types for PPC64
49910a431824831c1d57a62dd84346387238f516e0cRoman Divackyenum {
500a6cd815994a30888d579e7731a98e668f07a5965Nico Rieck  R_PPC64_NONE                = 0,
5017b449889e7886b263718b5103538970f287bc37eAdhemerval Zanella  R_PPC64_ADDR32              = 1,
502c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR24              = 2,
503c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR16              = 3,
50410a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_LO           = 4,
50510a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HI           = 5,
506c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR16_HA           = 6,
50710a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR14              = 7,
508c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR14_BRTAKEN      = 8,
509c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_ADDR14_BRNTAKEN     = 9,
51010a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_REL24               = 10,
511c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14               = 11,
512c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14_BRTAKEN       = 12,
513c37077af7bfdc22da2d267eee7905927dd5fdd17Ulrich Weigand  R_PPC64_REL14_BRNTAKEN      = 13,
5145de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16               = 14,
5155de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_LO            = 15,
5165de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_HI            = 16,
5175de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_HA            = 17,
518a1db5de9e70dd8ffda57b1a4373915ea866b6f1dAdhemerval Zanella  R_PPC64_REL32               = 26,
51910a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR64              = 38,
52010a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HIGHER       = 39,
521f7c1ee79fe90353fcd3f545f9d45a01a837bbf4bUlrich Weigand  R_PPC64_ADDR16_HIGHERA      = 40,
52210a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_ADDR16_HIGHEST      = 41,
523f7c1ee79fe90353fcd3f545f9d45a01a837bbf4bUlrich Weigand  R_PPC64_ADDR16_HIGHESTA     = 42,
5247b449889e7886b263718b5103538970f287bc37eAdhemerval Zanella  R_PPC64_REL64               = 44,
52510a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_TOC16               = 47,
52634a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_LO            = 48,
527f8f87dcfceadd1b842d130303a7091ad7d7d67d0Ulrich Weigand  R_PPC64_TOC16_HI            = 49,
52834a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_HA            = 50,
52910a431824831c1d57a62dd84346387238f516e0cRoman Divacky  R_PPC64_TOC                 = 51,
53065e90c036472380bba160c349412f37128608e1cUlrich Weigand  R_PPC64_ADDR16_DS           = 56,
53165e90c036472380bba160c349412f37128608e1cUlrich Weigand  R_PPC64_ADDR16_LO_DS        = 57,
5325de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_DS            = 58,
5335de735a962a255676cf3a9bc255579d465670633Ulrich Weigand  R_PPC64_GOT16_LO_DS         = 59,
53434a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt  R_PPC64_TOC16_DS            = 63,
535d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt  R_PPC64_TOC16_LO_DS         = 64,
536d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt  R_PPC64_TLS                 = 67,
537228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_DTPMOD64            = 68,
538cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16             = 69,
539fc7695a653323071ec141aee994e4188592ad1f5Bill Schmidt  R_PPC64_TPREL16_LO          = 70,
540cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HI          = 71,
541a6cd815994a30888d579e7731a98e668f07a5965Nico Rieck  R_PPC64_TPREL16_HA          = 72,
542228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_TPREL64             = 73,
543cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16            = 74,
544349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_DTPREL16_LO         = 75,
545cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HI         = 76,
546349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_DTPREL16_HA         = 77,
547228e0afcfd0d5f167a95c6ddbec2c6a4a90b6d2bUlrich Weigand  R_PPC64_DTPREL64            = 78,
548cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSGD16         = 79,
54957ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt  R_PPC64_GOT_TLSGD16_LO      = 80,
550cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSGD16_HI      = 81,
55157ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt  R_PPC64_GOT_TLSGD16_HA      = 82,
552cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSLD16         = 83,
553349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_GOT_TLSLD16_LO      = 84,
554cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TLSLD16_HI      = 85,
555349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_GOT_TLSLD16_HA      = 86,
556cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TPREL16_DS      = 87,
557b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt  R_PPC64_GOT_TPREL16_LO_DS   = 88,
558cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_TPREL16_HI      = 89,
559b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt  R_PPC64_GOT_TPREL16_HA      = 90,
560cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_DS     = 91,
561cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_LO_DS  = 92,
562cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_HI     = 93,
563cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_GOT_DTPREL16_HA     = 94,
564cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_DS          = 95,
565cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_LO_DS       = 96,
566cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHER      = 97,
567cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHERA     = 98,
568cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHEST     = 99,
569cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_TPREL16_HIGHESTA    = 100,
570cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_DS         = 101,
571cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_LO_DS      = 102,
572cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHER     = 103,
573cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHERA    = 104,
574cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHEST    = 105,
575cab0a1933875935c717136d251e2af9749533ba8Ulrich Weigand  R_PPC64_DTPREL16_HIGHESTA   = 106,
576349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt  R_PPC64_TLSGD               = 107,
57784569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_TLSLD               = 108,
57884569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16               = 249,
57984569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_LO            = 250,
58084569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_HI            = 251,
58184569698f01bcb49afe5b6140bf0d61cf4f3cf5aUlrich Weigand  R_PPC64_REL16_HA            = 252
58210a431824831c1d57a62dd84346387238f516e0cRoman Divacky};
58310a431824831c1d57a62dd84346387238f516e0cRoman Divacky
58472062f5744557e270a38192554c3126ea5f97434Tim Northover// ELF Relocation types for AArch64
58572062f5744557e270a38192554c3126ea5f97434Tim Northover
58672062f5744557e270a38192554c3126ea5f97434Tim Northoverenum {
58772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_NONE                        = 0x100,
58872062f5744557e270a38192554c3126ea5f97434Tim Northover
58972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS64                       = 0x101,
59072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS32                       = 0x102,
59172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ABS16                       = 0x103,
59272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL64                      = 0x104,
59372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL32                      = 0x105,
59472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_PREL16                      = 0x106,
59572062f5744557e270a38192554c3126ea5f97434Tim Northover
59672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G0                = 0x107,
59772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G0_NC             = 0x108,
59872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G1                = 0x109,
59972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G1_NC             = 0x10a,
60072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G2                = 0x10b,
60172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G2_NC             = 0x10c,
60272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_UABS_G3                = 0x10d,
60372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G0                = 0x10e,
60472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G1                = 0x10f,
60572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_MOVW_SABS_G2                = 0x110,
60672062f5744557e270a38192554c3126ea5f97434Tim Northover
60772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LD_PREL_LO19                = 0x111,
60872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_PREL_LO21               = 0x112,
60972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_PREL_PG_HI21            = 0x113,
61072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADD_ABS_LO12_NC             = 0x115,
61172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST8_ABS_LO12_NC           = 0x116,
61272062f5744557e270a38192554c3126ea5f97434Tim Northover
61372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TSTBR14                     = 0x117,
61472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_CONDBR19                    = 0x118,
61572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_JUMP26                      = 0x11a,
61672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_CALL26                      = 0x11b,
61772062f5744557e270a38192554c3126ea5f97434Tim Northover
61872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST16_ABS_LO12_NC          = 0x11c,
61972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST32_ABS_LO12_NC          = 0x11d,
62072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST64_ABS_LO12_NC          = 0x11e,
62172062f5744557e270a38192554c3126ea5f97434Tim Northover
62272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LDST128_ABS_LO12_NC         = 0x12b,
62372062f5744557e270a38192554c3126ea5f97434Tim Northover
62472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_ADR_GOT_PAGE                = 0x137,
62572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_LD64_GOT_LO12_NC            = 0x138,
62672062f5744557e270a38192554c3126ea5f97434Tim Northover
62772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G2        = 0x20b,
62872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G1        = 0x20c,
62972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC     = 0x20d,
63072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G0        = 0x20e,
63172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC     = 0x20f,
63272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_HI12       = 0x210,
63372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_LO12       = 0x211,
63472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC    = 0x212,
63572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST8_DTPREL_LO12     = 0x213,
63672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC  = 0x214,
63772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST16_DTPREL_LO12    = 0x215,
63872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC = 0x216,
63972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST32_DTPREL_LO12    = 0x217,
64072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC = 0x218,
64172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST64_DTPREL_LO12    = 0x219,
64272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC = 0x21a,
64372062f5744557e270a38192554c3126ea5f97434Tim Northover
64472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_MOVW_GOTTPREL_G1      = 0x21b,
64572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC   = 0x21c,
64672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21   = 0x21d,
64772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC = 0x21e,
64872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSIE_LD_GOTTPREL_PREL19    = 0x21f,
64972062f5744557e270a38192554c3126ea5f97434Tim Northover
65072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G2         = 0x220,
65172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G1         = 0x221,
65272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G1_NC      = 0x222,
65372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G0         = 0x223,
65472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_MOVW_TPREL_G0_NC      = 0x224,
65572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_HI12        = 0x225,
65672062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_LO12        = 0x226,
65772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_ADD_TPREL_LO12_NC     = 0x227,
65872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST8_TPREL_LO12      = 0x228,
65972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC   = 0x229,
66072062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST16_TPREL_LO12     = 0x22a,
66172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC  = 0x22b,
66272062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST32_TPREL_LO12     = 0x22c,
66372062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC  = 0x22d,
66472062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST64_TPREL_LO12     = 0x22e,
66572062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC  = 0x22f,
66672062f5744557e270a38192554c3126ea5f97434Tim Northover
66772062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_ADR_PAGE            = 0x232,
66872062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_LD64_LO12_NC        = 0x233,
66972062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_ADD_LO12_NC         = 0x234,
67072062f5744557e270a38192554c3126ea5f97434Tim Northover
67172062f5744557e270a38192554c3126ea5f97434Tim Northover  R_AARCH64_TLSDESC_CALL                = 0x239
67272062f5744557e270a38192554c3126ea5f97434Tim Northover};
67372062f5744557e270a38192554c3126ea5f97434Tim Northover
674