1a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes/* $NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $ */ 2a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 3a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB 4a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ELF32_MACHDEP_ID_CASES \ 5a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes case EM_386: \ 6a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes case EM_486: \ 7a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes break; 8a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 9a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */ 10a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ELF64_MACHDEP_ID_CASES \ 11a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes /* no 64-bit ELF machine types supported */ 12a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 13a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ELF32_MACHDEP_ID EM_386 14a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 15a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define ARCH_ELFSIZE 32 /* MD native binary size */ 16a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 17a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes/* i386 relocations */ 18a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_NONE 0 19a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_32 1 20a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_PC32 2 21a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_GOT32 3 22a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_PLT32 4 23a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_COPY 5 24a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_GLOB_DAT 6 25a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_JMP_SLOT 7 26a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_RELATIVE 8 27a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_GOTOFF 9 28a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_GOTPC 10 29a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 30a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes/* TLS relocations */ 31a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_TPOFF 14 32a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_IE 15 33a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GOTIE 16 34a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LE 17 35a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GD 18 36a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDM 19 37a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 38a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes/* The following relocations are GNU extensions. */ 39a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_16 20 40a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_PC16 21 41a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_8 22 42a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_PC8 23 43a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 44a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes/* More TLS relocations */ 45a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GD_32 24 46a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GD_PUSH 25 47a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GD_CALL 26 48a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GD_POP 27 49a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDM_32 28 50a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDM_PUSH 29 51a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDM_CALL 30 52a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDM_POP 31 53a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LDO_32 32 54a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_IE_32 33 55a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_LE_32 34 56a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_DTPMOD32 35 57a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_DTPOFF32 36 58a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_TPOFF32 37 59a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_GOTDESC 39 60a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_DESC_CALL 40 61a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_386_TLS_DESC 41 629aea164457c269c475592da36b4655d45f55c7bcDmitriy Ivanov#define R_386_IRELATIVE 42 63a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes 64a6a3ac59243d8c95c94c3069e9332051f785c05fElliott Hughes#define R_TYPE(name) __CONCAT(R_386_,name) 65