From 9cf35733278f61a284d597cb76e2b323acd34ee6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 3 Oct 2007 20:54:32 +0000 Subject: From Craig Silvestein: document the i386 relocs. --- elfcpp/i386.h | 73 +++++++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) (limited to 'elfcpp') diff --git a/elfcpp/i386.h b/elfcpp/i386.h index 1393788..9550bc8 100644 --- a/elfcpp/i386.h +++ b/elfcpp/i386.h @@ -32,51 +32,54 @@ #ifndef ELFCPP_I386_H #define ELFCPP_I386_H +// Documentation for the TLS relocs is taken from +// http://people.redhat.com/drepper/tls.pdf + namespace elfcpp { enum { - R_386_NONE = 0, - R_386_32 = 1, - R_386_PC32 = 2, - R_386_GOT32 = 3, - R_386_PLT32 = 4, - R_386_COPY = 5, - R_386_GLOB_DAT = 6, - R_386_JUMP_SLOT = 7, - R_386_RELATIVE = 8, - R_386_GOTOFF = 9, - R_386_GOTPC = 10, + R_386_NONE = 0, // No reloc + R_386_32 = 1, // Direct 32 bit zero extended + R_386_PC32 = 2, // PC relative 32 bit signed + R_386_GOT32 = 3, // 32 bit GOT entry + R_386_PLT32 = 4, // 32 bit PLT address + R_386_COPY = 5, // Copy symbol at runtime + R_386_GLOB_DAT = 6, // Create GOT entry + R_386_JUMP_SLOT = 7, // Create PLT entry + R_386_RELATIVE = 8, // Adjust by program base + R_386_GOTOFF = 9, // 32-bit GOT offset + R_386_GOTPC = 10, // 32-bit PC relative offset to GOT // Used by Sun. R_386_32PLT = 11, // TLS extensions. - R_386_TLS_TPOFF = 14, - R_386_TLS_IE = 15, - R_386_TLS_GOTIE = 16, - R_386_TLS_LE = 17, - R_386_TLS_GD = 18, - R_386_TLS_LDM = 19, + R_386_TLS_TPOFF = 14, // Outstanding Initial Exec reloc, gnu-style (both) + R_386_TLS_IE = 15, // Initial Initial Exec reloc, gnu-style (no-PIC) + R_386_TLS_GOTIE = 16, // Initial Initial Exec reloc, gnu-style (for PIC) + R_386_TLS_LE = 17, // Initial Local Exec reloc, gnu-style + R_386_TLS_GD = 18, // Initial General Dynamic reloc, gnu-style + R_386_TLS_LDM = 19, // Initial Local Dynamic reloc, gnu-style // GNU extensions. - R_386_16 = 20, - R_386_PC16 = 21, - R_386_8 = 22, - R_386_PC8 = 23, + R_386_16 = 20, // Direct 16 bit zero extended + R_386_PC16 = 21, // 16 bit sign extended pc relative + R_386_8 = 22, // Direct 8 bit sign extended + R_386_PC8 = 23, // 8 bit sign extended pc relative // More TLS relocs. - R_386_TLS_GD_32 = 24, - R_386_TLS_GD_PUSH = 25, - R_386_TLS_GD_CALL = 26, - R_386_TLS_GD_POP = 27, - R_386_TLS_LDM_32 = 28, - R_386_TLS_LDM_PUSH = 29, - R_386_TLS_LDM_CALL = 30, - R_386_TLS_LDM_POP = 31, - R_386_TLS_LDO_32 = 32, - R_386_TLS_IE_32 = 33, - R_386_TLS_LE_32 = 34, - R_386_TLS_DTPMOD32 = 35, - R_386_TLS_DTPOFF32 = 36, - R_386_TLS_TPOFF32 = 37, + R_386_TLS_GD_32 = 24, // Initial General Dynamic reloc, sun-style + R_386_TLS_GD_PUSH = 25, // Initial General Dynamic reloc, sun-style + R_386_TLS_GD_CALL = 26, // Initial General Dynamic reloc, sun-style + R_386_TLS_GD_POP = 27, // Initial General Dynamic reloc, sun-style + R_386_TLS_LDM_32 = 28, // Initial Local Dynamic reloc, sun-style + R_386_TLS_LDM_PUSH = 29, // Initial Local Dynamic reloc, sun-style + R_386_TLS_LDM_CALL = 30, // Initial Local Dynamic reloc, sun-style + R_386_TLS_LDM_POP = 31, // Initial Local Dynamic reloc, sun-style + R_386_TLS_LDO_32 = 32, // Initial Local Dynamic reloc, sun+gnu styles + R_386_TLS_IE_32 = 33, // Initial Initial Exec reloc, sun-style + R_386_TLS_LE_32 = 34, // Initial Local Exec reloc, sun-style + R_386_TLS_DTPMOD32 = 35, // Outstanding General/Local Dynamic reloc, sun+gnu + R_386_TLS_DTPOFF32 = 36, // Outstanding General Dynamic reloc, sun+gnu + R_386_TLS_TPOFF32 = 37, // Outstanding Initial Exec reloc, sun-style R_386_TLS_GOTDESC = 39, R_386_TLS_DESC_CALL = 40, R_386_TLS_DESC = 41, -- cgit v1.1