xref: /netbsd-src/external/gpl3/binutils/dist/elfcpp/i386.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
12a6b7db3Sskrll // i386.h -- ELF definitions specific to EM_386  -*- C++ -*-
22a6b7db3Sskrll 
3*cb63e24eSchristos // Copyright (C) 2006-2024 Free Software Foundation, Inc.
42a6b7db3Sskrll // Written by Ian Lance Taylor <iant@google.com>.
52a6b7db3Sskrll 
62a6b7db3Sskrll // This file is part of elfcpp.
72a6b7db3Sskrll 
82a6b7db3Sskrll // This program is free software; you can redistribute it and/or
92a6b7db3Sskrll // modify it under the terms of the GNU Library General Public License
102a6b7db3Sskrll // as published by the Free Software Foundation; either version 2, or
112a6b7db3Sskrll // (at your option) any later version.
122a6b7db3Sskrll 
132a6b7db3Sskrll // In addition to the permissions in the GNU Library General Public
142a6b7db3Sskrll // License, the Free Software Foundation gives you unlimited
152a6b7db3Sskrll // permission to link the compiled version of this file into
162a6b7db3Sskrll // combinations with other programs, and to distribute those
172a6b7db3Sskrll // combinations without any restriction coming from the use of this
182a6b7db3Sskrll // file.  (The Library Public License restrictions do apply in other
192a6b7db3Sskrll // respects; for example, they cover modification of the file, and
202a6b7db3Sskrll /// distribution when not linked into a combined executable.)
212a6b7db3Sskrll 
222a6b7db3Sskrll // This program is distributed in the hope that it will be useful, but
232a6b7db3Sskrll // WITHOUT ANY WARRANTY; without even the implied warranty of
242a6b7db3Sskrll // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
252a6b7db3Sskrll // Library General Public License for more details.
262a6b7db3Sskrll 
272a6b7db3Sskrll // You should have received a copy of the GNU Library General Public
282a6b7db3Sskrll // License along with this program; if not, write to the Free Software
292a6b7db3Sskrll // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
302a6b7db3Sskrll // 02110-1301, USA.
312a6b7db3Sskrll 
322a6b7db3Sskrll #ifndef ELFCPP_I386_H
332a6b7db3Sskrll #define ELFCPP_I386_H
342a6b7db3Sskrll 
352a6b7db3Sskrll // Documentation for the TLS relocs is taken from
362a6b7db3Sskrll //   http://people.redhat.com/drepper/tls.pdf
372a6b7db3Sskrll //   http://www.lsd.ic.unicamp.br/~oliva/writeups/TLS/RFC-TLSDESC-x86.txt
382a6b7db3Sskrll 
392a6b7db3Sskrll namespace elfcpp
402a6b7db3Sskrll {
412a6b7db3Sskrll 
422a6b7db3Sskrll enum
432a6b7db3Sskrll {
442a6b7db3Sskrll   R_386_NONE = 0,        // No reloc
452a6b7db3Sskrll   R_386_32 = 1,          // Direct 32 bit zero extended
462a6b7db3Sskrll   R_386_PC32 = 2,        // PC relative 32 bit signed
472a6b7db3Sskrll   R_386_GOT32 = 3,       // 32 bit GOT entry
482a6b7db3Sskrll   R_386_PLT32 = 4,       // 32 bit PLT address
492a6b7db3Sskrll   R_386_COPY = 5,        // Copy symbol at runtime
502a6b7db3Sskrll   R_386_GLOB_DAT = 6,    // Create GOT entry
512a6b7db3Sskrll   R_386_JUMP_SLOT = 7,   // Create PLT entry
522a6b7db3Sskrll   R_386_RELATIVE = 8,    // Adjust by program base
532a6b7db3Sskrll   R_386_GOTOFF = 9,      // 32-bit GOT offset
542a6b7db3Sskrll   R_386_GOTPC = 10,      // 32-bit PC relative offset to GOT
552a6b7db3Sskrll   // Used by Sun.
562a6b7db3Sskrll   R_386_32PLT = 11,
572a6b7db3Sskrll   // TLS extensions.
582a6b7db3Sskrll   R_386_TLS_TPOFF = 14,  // Outstanding Initial Exec reloc, gnu-style (both)
592a6b7db3Sskrll   R_386_TLS_IE = 15,     // Initial Initial Exec reloc, gnu-style (no-PIC)
602a6b7db3Sskrll   R_386_TLS_GOTIE = 16,  // Initial Initial Exec reloc, gnu-style (for PIC)
612a6b7db3Sskrll   R_386_TLS_LE = 17,     // Initial Local Exec reloc, gnu-style
622a6b7db3Sskrll   R_386_TLS_GD = 18,     // Initial General Dynamic reloc, gnu-style
632a6b7db3Sskrll   R_386_TLS_LDM = 19,    // Initial Local Dynamic reloc, gnu-style
642a6b7db3Sskrll   // GNU extensions.
652a6b7db3Sskrll   R_386_16 = 20,         // Direct 16 bit zero extended
662a6b7db3Sskrll   R_386_PC16 = 21,       // 16 bit sign extended pc relative
672a6b7db3Sskrll   R_386_8 = 22,          // Direct 8 bit sign extended
682a6b7db3Sskrll   R_386_PC8 = 23,        // 8 bit sign extended pc relative
692a6b7db3Sskrll   // More TLS relocs.
702a6b7db3Sskrll   R_386_TLS_GD_32 = 24,     // Initial General Dynamic reloc, sun-style
712a6b7db3Sskrll   R_386_TLS_GD_PUSH = 25,   // Initial General Dynamic reloc, sun-style
722a6b7db3Sskrll   R_386_TLS_GD_CALL = 26,   // Initial General Dynamic reloc, sun-style
732a6b7db3Sskrll   R_386_TLS_GD_POP = 27,    // Initial General Dynamic reloc, sun-style
742a6b7db3Sskrll   R_386_TLS_LDM_32 = 28,    // Initial Local Dynamic reloc, sun-style
752a6b7db3Sskrll   R_386_TLS_LDM_PUSH = 29,  // Initial Local Dynamic reloc, sun-style
762a6b7db3Sskrll   R_386_TLS_LDM_CALL = 30,  // Initial Local Dynamic reloc, sun-style
772a6b7db3Sskrll   R_386_TLS_LDM_POP = 31,   // Initial Local Dynamic reloc, sun-style
782a6b7db3Sskrll   R_386_TLS_LDO_32 = 32,    // Initial Local Dynamic reloc, sun+gnu styles
792a6b7db3Sskrll   R_386_TLS_IE_32 = 33,     // Initial Initial Exec reloc, sun-style
802a6b7db3Sskrll   R_386_TLS_LE_32 = 34,     // Initial Local Exec reloc, sun-style
812a6b7db3Sskrll   R_386_TLS_DTPMOD32 = 35,  // Outstanding General/Local Dynamic reloc, sun+gnu
822a6b7db3Sskrll   R_386_TLS_DTPOFF32 = 36,  // Outstanding General Dynamic reloc, sun+gnu
832a6b7db3Sskrll   R_386_TLS_TPOFF32 = 37,   // Outstanding Initial Exec reloc, sun-style
842a6b7db3Sskrll   R_386_TLS_GOTDESC = 39,   // GOT offset for TLS descriptor
852a6b7db3Sskrll   R_386_TLS_DESC_CALL = 40, // Marker of call through TLS desc for relaxation
862a6b7db3Sskrll   R_386_TLS_DESC = 41,      // TLS descriptor containing pointer to code and
872a6b7db3Sskrll                             // to argument, returning TLS offset for symbol
88be12b8bcSchristos   R_386_IRELATIVE = 42,     // Adjust indirectly by program base
899573673dSchristos   R_386_GOT32X = 43,        // 32 bit GOT entry, relaxable
902a6b7db3Sskrll   // Used by Intel.
912a6b7db3Sskrll   R_386_USED_BY_INTEL_200 = 200,
922a6b7db3Sskrll   // GNU vtable garbage collection extensions.
932a6b7db3Sskrll   R_386_GNU_VTINHERIT = 250,
942a6b7db3Sskrll   R_386_GNU_VTENTRY = 251
952a6b7db3Sskrll };
962a6b7db3Sskrll 
972a6b7db3Sskrll } // End namespace elfcpp.
982a6b7db3Sskrll 
992a6b7db3Sskrll #endif // !defined(ELFCPP_I386_H)
100