175fd0b74Schristos // i386.h -- ELF definitions specific to EM_386 -*- C++ -*- 275fd0b74Schristos 3*e992f068Schristos // Copyright (C) 2006-2022 Free Software Foundation, Inc. 475fd0b74Schristos // Written by Ian Lance Taylor <iant@google.com>. 575fd0b74Schristos 675fd0b74Schristos // This file is part of elfcpp. 775fd0b74Schristos 875fd0b74Schristos // This program is free software; you can redistribute it and/or 975fd0b74Schristos // modify it under the terms of the GNU Library General Public License 1075fd0b74Schristos // as published by the Free Software Foundation; either version 2, or 1175fd0b74Schristos // (at your option) any later version. 1275fd0b74Schristos 1375fd0b74Schristos // In addition to the permissions in the GNU Library General Public 1475fd0b74Schristos // License, the Free Software Foundation gives you unlimited 1575fd0b74Schristos // permission to link the compiled version of this file into 1675fd0b74Schristos // combinations with other programs, and to distribute those 1775fd0b74Schristos // combinations without any restriction coming from the use of this 1875fd0b74Schristos // file. (The Library Public License restrictions do apply in other 1975fd0b74Schristos // respects; for example, they cover modification of the file, and 2075fd0b74Schristos /// distribution when not linked into a combined executable.) 2175fd0b74Schristos 2275fd0b74Schristos // This program is distributed in the hope that it will be useful, but 2375fd0b74Schristos // WITHOUT ANY WARRANTY; without even the implied warranty of 2475fd0b74Schristos // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2575fd0b74Schristos // Library General Public License for more details. 2675fd0b74Schristos 2775fd0b74Schristos // You should have received a copy of the GNU Library General Public 2875fd0b74Schristos // License along with this program; if not, write to the Free Software 2975fd0b74Schristos // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 3075fd0b74Schristos // 02110-1301, USA. 3175fd0b74Schristos 3275fd0b74Schristos #ifndef ELFCPP_I386_H 3375fd0b74Schristos #define ELFCPP_I386_H 3475fd0b74Schristos 3575fd0b74Schristos // Documentation for the TLS relocs is taken from 3675fd0b74Schristos // http://people.redhat.com/drepper/tls.pdf 3775fd0b74Schristos // http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt 3875fd0b74Schristos 3975fd0b74Schristos namespace elfcpp 4075fd0b74Schristos { 4175fd0b74Schristos 4275fd0b74Schristos enum 4375fd0b74Schristos { 4475fd0b74Schristos R_386_NONE = 0, // No reloc 4575fd0b74Schristos R_386_32 = 1, // Direct 32 bit zero extended 4675fd0b74Schristos R_386_PC32 = 2, // PC relative 32 bit signed 4775fd0b74Schristos R_386_GOT32 = 3, // 32 bit GOT entry 4875fd0b74Schristos R_386_PLT32 = 4, // 32 bit PLT address 4975fd0b74Schristos R_386_COPY = 5, // Copy symbol at runtime 5075fd0b74Schristos R_386_GLOB_DAT = 6, // Create GOT entry 5175fd0b74Schristos R_386_JUMP_SLOT = 7, // Create PLT entry 5275fd0b74Schristos R_386_RELATIVE = 8, // Adjust by program base 5375fd0b74Schristos R_386_GOTOFF = 9, // 32-bit GOT offset 5475fd0b74Schristos R_386_GOTPC = 10, // 32-bit PC relative offset to GOT 5575fd0b74Schristos // Used by Sun. 5675fd0b74Schristos R_386_32PLT = 11, 5775fd0b74Schristos // TLS extensions. 5875fd0b74Schristos R_386_TLS_TPOFF = 14, // Outstanding Initial Exec reloc, gnu-style (both) 5975fd0b74Schristos R_386_TLS_IE = 15, // Initial Initial Exec reloc, gnu-style (no-PIC) 6075fd0b74Schristos R_386_TLS_GOTIE = 16, // Initial Initial Exec reloc, gnu-style (for PIC) 6175fd0b74Schristos R_386_TLS_LE = 17, // Initial Local Exec reloc, gnu-style 6275fd0b74Schristos R_386_TLS_GD = 18, // Initial General Dynamic reloc, gnu-style 6375fd0b74Schristos R_386_TLS_LDM = 19, // Initial Local Dynamic reloc, gnu-style 6475fd0b74Schristos // GNU extensions. 6575fd0b74Schristos R_386_16 = 20, // Direct 16 bit zero extended 6675fd0b74Schristos R_386_PC16 = 21, // 16 bit sign extended pc relative 6775fd0b74Schristos R_386_8 = 22, // Direct 8 bit sign extended 6875fd0b74Schristos R_386_PC8 = 23, // 8 bit sign extended pc relative 6975fd0b74Schristos // More TLS relocs. 7075fd0b74Schristos R_386_TLS_GD_32 = 24, // Initial General Dynamic reloc, sun-style 7175fd0b74Schristos R_386_TLS_GD_PUSH = 25, // Initial General Dynamic reloc, sun-style 7275fd0b74Schristos R_386_TLS_GD_CALL = 26, // Initial General Dynamic reloc, sun-style 7375fd0b74Schristos R_386_TLS_GD_POP = 27, // Initial General Dynamic reloc, sun-style 7475fd0b74Schristos R_386_TLS_LDM_32 = 28, // Initial Local Dynamic reloc, sun-style 7575fd0b74Schristos R_386_TLS_LDM_PUSH = 29, // Initial Local Dynamic reloc, sun-style 7675fd0b74Schristos R_386_TLS_LDM_CALL = 30, // Initial Local Dynamic reloc, sun-style 7775fd0b74Schristos R_386_TLS_LDM_POP = 31, // Initial Local Dynamic reloc, sun-style 7875fd0b74Schristos R_386_TLS_LDO_32 = 32, // Initial Local Dynamic reloc, sun+gnu styles 7975fd0b74Schristos R_386_TLS_IE_32 = 33, // Initial Initial Exec reloc, sun-style 8075fd0b74Schristos R_386_TLS_LE_32 = 34, // Initial Local Exec reloc, sun-style 8175fd0b74Schristos R_386_TLS_DTPMOD32 = 35, // Outstanding General/Local Dynamic reloc, sun+gnu 8275fd0b74Schristos R_386_TLS_DTPOFF32 = 36, // Outstanding General Dynamic reloc, sun+gnu 8375fd0b74Schristos R_386_TLS_TPOFF32 = 37, // Outstanding Initial Exec reloc, sun-style 8475fd0b74Schristos R_386_TLS_GOTDESC = 39, // GOT offset for TLS descriptor 8575fd0b74Schristos R_386_TLS_DESC_CALL = 40, // Marker of call through TLS desc for relaxation 8675fd0b74Schristos R_386_TLS_DESC = 41, // TLS descriptor containing pointer to code and 8775fd0b74Schristos // to argument, returning TLS offset for symbol 8875fd0b74Schristos R_386_IRELATIVE = 42, // Adjust indirectly by program base 8975fd0b74Schristos R_386_GOT32X = 43, // 32 bit GOT entry, relaxable 9075fd0b74Schristos // Used by Intel. 9175fd0b74Schristos R_386_USED_BY_INTEL_200 = 200, 9275fd0b74Schristos // GNU vtable garbage collection extensions. 9375fd0b74Schristos R_386_GNU_VTINHERIT = 250, 9475fd0b74Schristos R_386_GNU_VTENTRY = 251 9575fd0b74Schristos }; 9675fd0b74Schristos 9775fd0b74Schristos } // End namespace elfcpp. 9875fd0b74Schristos 9975fd0b74Schristos #endif // !defined(ELFCPP_I386_H) 100