111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* $NetBSD: elf_machdep.h,v 1.10 2009/05/30 05:56:52 skrll Exp $ */ 211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ELF32_MACHDEP_ENDIANNESS ELFDATA2LSB 411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ELF32_MACHDEP_ID_CASES \ 511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert case EM_386: \ 611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert case EM_486: \ 711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert break; 811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ELF64_MACHDEP_ENDIANNESS XXX /* break compilation */ 1011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ELF64_MACHDEP_ID_CASES \ 1111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert /* no 64-bit ELF machine types supported */ 1211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 1311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ELF32_MACHDEP_ID EM_386 1411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 1511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define ARCH_ELFSIZE 32 /* MD native binary size */ 1611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 1711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* i386 relocations */ 1811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_NONE 0 1911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_32 1 2011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_PC32 2 2111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_GOT32 3 2211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_PLT32 4 2311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_COPY 5 2411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_GLOB_DAT 6 2511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_JMP_SLOT 7 2611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_RELATIVE 8 2711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_GOTOFF 9 2811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_GOTPC 10 2911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 3011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* TLS relocations */ 3111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_TPOFF 14 3211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_IE 15 3311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GOTIE 16 3411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LE 17 3511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GD 18 3611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDM 19 3711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 3811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* The following relocations are GNU extensions. */ 3911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_16 20 4011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_PC16 21 4111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_8 22 4211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_PC8 23 4311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 4411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert/* More TLS relocations */ 4511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GD_32 24 4611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GD_PUSH 25 4711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GD_CALL 26 4811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GD_POP 27 4911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDM_32 28 5011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDM_PUSH 29 5111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDM_CALL 30 5211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDM_POP 31 5311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LDO_32 32 5411cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_IE_32 33 5511cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_LE_32 34 5611cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_DTPMOD32 35 5711cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_DTPOFF32 36 5811cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_TPOFF32 37 5911cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_GOTDESC 39 6011cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_DESC_CALL 40 6111cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_386_TLS_DESC 41 6211cd02dfb91661c65134cac258cf5924270e9d2Dan Albert 6311cd02dfb91661c65134cac258cf5924270e9d2Dan Albert#define R_TYPE(name) __CONCAT(R_386_,name) 64