1*a9fa9459Szrj // i386.h -- ELF definitions specific to EM_386 -*- C++ -*- 2*a9fa9459Szrj 3*a9fa9459Szrj // Copyright (C) 2006-2016 Free Software Foundation, Inc. 4*a9fa9459Szrj // Written by Ian Lance Taylor <iant@google.com>. 5*a9fa9459Szrj 6*a9fa9459Szrj // This file is part of elfcpp. 7*a9fa9459Szrj 8*a9fa9459Szrj // This program is free software; you can redistribute it and/or 9*a9fa9459Szrj // modify it under the terms of the GNU Library General Public License 10*a9fa9459Szrj // as published by the Free Software Foundation; either version 2, or 11*a9fa9459Szrj // (at your option) any later version. 12*a9fa9459Szrj 13*a9fa9459Szrj // In addition to the permissions in the GNU Library General Public 14*a9fa9459Szrj // License, the Free Software Foundation gives you unlimited 15*a9fa9459Szrj // permission to link the compiled version of this file into 16*a9fa9459Szrj // combinations with other programs, and to distribute those 17*a9fa9459Szrj // combinations without any restriction coming from the use of this 18*a9fa9459Szrj // file. (The Library Public License restrictions do apply in other 19*a9fa9459Szrj // respects; for example, they cover modification of the file, and 20*a9fa9459Szrj /// distribution when not linked into a combined executable.) 21*a9fa9459Szrj 22*a9fa9459Szrj // This program is distributed in the hope that it will be useful, but 23*a9fa9459Szrj // WITHOUT ANY WARRANTY; without even the implied warranty of 24*a9fa9459Szrj // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25*a9fa9459Szrj // Library General Public License for more details. 26*a9fa9459Szrj 27*a9fa9459Szrj // You should have received a copy of the GNU Library General Public 28*a9fa9459Szrj // License along with this program; if not, write to the Free Software 29*a9fa9459Szrj // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 30*a9fa9459Szrj // 02110-1301, USA. 31*a9fa9459Szrj 32*a9fa9459Szrj #ifndef ELFCPP_I386_H 33*a9fa9459Szrj #define ELFCPP_I386_H 34*a9fa9459Szrj 35*a9fa9459Szrj // Documentation for the TLS relocs is taken from 36*a9fa9459Szrj // http://people.redhat.com/drepper/tls.pdf 37*a9fa9459Szrj // http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt 38*a9fa9459Szrj 39*a9fa9459Szrj namespace elfcpp 40*a9fa9459Szrj { 41*a9fa9459Szrj 42*a9fa9459Szrj enum 43*a9fa9459Szrj { 44*a9fa9459Szrj R_386_NONE = 0, // No reloc 45*a9fa9459Szrj R_386_32 = 1, // Direct 32 bit zero extended 46*a9fa9459Szrj R_386_PC32 = 2, // PC relative 32 bit signed 47*a9fa9459Szrj R_386_GOT32 = 3, // 32 bit GOT entry 48*a9fa9459Szrj R_386_PLT32 = 4, // 32 bit PLT address 49*a9fa9459Szrj R_386_COPY = 5, // Copy symbol at runtime 50*a9fa9459Szrj R_386_GLOB_DAT = 6, // Create GOT entry 51*a9fa9459Szrj R_386_JUMP_SLOT = 7, // Create PLT entry 52*a9fa9459Szrj R_386_RELATIVE = 8, // Adjust by program base 53*a9fa9459Szrj R_386_GOTOFF = 9, // 32-bit GOT offset 54*a9fa9459Szrj R_386_GOTPC = 10, // 32-bit PC relative offset to GOT 55*a9fa9459Szrj // Used by Sun. 56*a9fa9459Szrj R_386_32PLT = 11, 57*a9fa9459Szrj // TLS extensions. 58*a9fa9459Szrj R_386_TLS_TPOFF = 14, // Outstanding Initial Exec reloc, gnu-style (both) 59*a9fa9459Szrj R_386_TLS_IE = 15, // Initial Initial Exec reloc, gnu-style (no-PIC) 60*a9fa9459Szrj R_386_TLS_GOTIE = 16, // Initial Initial Exec reloc, gnu-style (for PIC) 61*a9fa9459Szrj R_386_TLS_LE = 17, // Initial Local Exec reloc, gnu-style 62*a9fa9459Szrj R_386_TLS_GD = 18, // Initial General Dynamic reloc, gnu-style 63*a9fa9459Szrj R_386_TLS_LDM = 19, // Initial Local Dynamic reloc, gnu-style 64*a9fa9459Szrj // GNU extensions. 65*a9fa9459Szrj R_386_16 = 20, // Direct 16 bit zero extended 66*a9fa9459Szrj R_386_PC16 = 21, // 16 bit sign extended pc relative 67*a9fa9459Szrj R_386_8 = 22, // Direct 8 bit sign extended 68*a9fa9459Szrj R_386_PC8 = 23, // 8 bit sign extended pc relative 69*a9fa9459Szrj // More TLS relocs. 70*a9fa9459Szrj R_386_TLS_GD_32 = 24, // Initial General Dynamic reloc, sun-style 71*a9fa9459Szrj R_386_TLS_GD_PUSH = 25, // Initial General Dynamic reloc, sun-style 72*a9fa9459Szrj R_386_TLS_GD_CALL = 26, // Initial General Dynamic reloc, sun-style 73*a9fa9459Szrj R_386_TLS_GD_POP = 27, // Initial General Dynamic reloc, sun-style 74*a9fa9459Szrj R_386_TLS_LDM_32 = 28, // Initial Local Dynamic reloc, sun-style 75*a9fa9459Szrj R_386_TLS_LDM_PUSH = 29, // Initial Local Dynamic reloc, sun-style 76*a9fa9459Szrj R_386_TLS_LDM_CALL = 30, // Initial Local Dynamic reloc, sun-style 77*a9fa9459Szrj R_386_TLS_LDM_POP = 31, // Initial Local Dynamic reloc, sun-style 78*a9fa9459Szrj R_386_TLS_LDO_32 = 32, // Initial Local Dynamic reloc, sun+gnu styles 79*a9fa9459Szrj R_386_TLS_IE_32 = 33, // Initial Initial Exec reloc, sun-style 80*a9fa9459Szrj R_386_TLS_LE_32 = 34, // Initial Local Exec reloc, sun-style 81*a9fa9459Szrj R_386_TLS_DTPMOD32 = 35, // Outstanding General/Local Dynamic reloc, sun+gnu 82*a9fa9459Szrj R_386_TLS_DTPOFF32 = 36, // Outstanding General Dynamic reloc, sun+gnu 83*a9fa9459Szrj R_386_TLS_TPOFF32 = 37, // Outstanding Initial Exec reloc, sun-style 84*a9fa9459Szrj R_386_TLS_GOTDESC = 39, // GOT offset for TLS descriptor 85*a9fa9459Szrj R_386_TLS_DESC_CALL = 40, // Marker of call through TLS desc for relaxation 86*a9fa9459Szrj R_386_TLS_DESC = 41, // TLS descriptor containing pointer to code and 87*a9fa9459Szrj // to argument, returning TLS offset for symbol 88*a9fa9459Szrj R_386_IRELATIVE = 42, // Adjust indirectly by program base 89*a9fa9459Szrj R_386_GOT32X = 43, // 32 bit GOT entry, relaxable 90*a9fa9459Szrj // Used by Intel. 91*a9fa9459Szrj R_386_USED_BY_INTEL_200 = 200, 92*a9fa9459Szrj // GNU vtable garbage collection extensions. 93*a9fa9459Szrj R_386_GNU_VTINHERIT = 250, 94*a9fa9459Szrj R_386_GNU_VTENTRY = 251 95*a9fa9459Szrj }; 96*a9fa9459Szrj 97*a9fa9459Szrj } // End namespace elfcpp. 98*a9fa9459Szrj 99*a9fa9459Szrj #endif // !defined(ELFCPP_I386_H) 100