dtprel@ha */ #define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */ #define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ #define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ #define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ #define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ #define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ #define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ #define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ #define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ #define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */ #define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */ #define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ #define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ #define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */ #define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ #define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ #define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ /* Keep this the last entry. */ #define R_PPC_NUM 95 /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ #define R_PPC_EMB_NADDR32 101 #define R_PPC_EMB_NADDR16 102 #define R_PPC_EMB_NADDR16_LO 103 #define R_PPC_EMB_NADDR16_HI 104 #define R_PPC_EMB_NADDR16_HA 105 #define R_PPC_EMB_SDAI16 106 #define R_PPC_EMB_SDA2I16 107 #define R_PPC_EMB_SDA2REL 108 #define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ #define R_PPC_EMB_MRKREF 110 #define R_PPC_EMB_RELSEC16 111 #define R_PPC_EMB_RELST_LO 112 #define R_PPC_EMB_RELST_HI 113 #define R_PPC_EMB_RELST_HA 114 #define R_PPC_EMB_BIT_FLD 115 #define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ /* Diab tool relocations. */ #define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ #define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ #define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ #define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ #define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ #define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ /* GNU relocs used in PIC code sequences. */ #define R_PPC_REL16 249 /* word32 (sym+add-.) */ #define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */ #define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */ #define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */ /* This is a phony reloc to handle any old fashioned TOC16 references that may still be in object files. */ #define R_PPC_TOC16 255 /* PowerPC specific values for the Dyn d_tag field. */ #define DT_PPC_GOT (DT_LOPROC + 0) #define DT_PPC_NUM 1 /* PowerPC64 relocations defined by the ABIs */ #define R_PPC64_NONE R_PPC_NONE #define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */ #define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */ #define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */ #define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */ #define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */ #define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ #define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */ #define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN #define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN #define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */ #define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */ #define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN #define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN #define R_PPC64_GOT16 R_PPC_GOT16 #define R_PPC64_GOT16_LO R_PPC_GOT16_LO #define R_PPC64_GOT16_HI R_PPC_GOT16_HI #define R_PPC64_GOT16_HA R_PPC_GOT16_HA #define R_PPC64_COPY R_PPC_COPY #define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT #define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT #define R_PPC64_RELATIVE R_PPC_RELATIVE #define R_PPC64_UADDR32 R_PPC_UADDR32 #define R_PPC64_UADDR16 R_PPC_UADDR16 #define R_PPC64_REL32 R_PPC_REL32 #define R_PPC64_PLT32 R_PPC_PLT32 #define R_PPC64_PLTREL32 R_PPC_PLTREL32 #define R_PPC64_PLT16_LO R_PPC_PLT16_LO #define R_PPC64_PLT16_HI R_PPC_PLT16_HI #define R_PPC64_PLT16_HA R_PPC_PLT16_HA #define R_PPC64_SECTOFF R_PPC_SECTOFF #define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO #define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI #define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA #define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */ #define R_PPC64_ADDR64 38 /* doubleword64 S + A */ #define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */ #define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */ #define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */ #define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */ #define R_PPC64_UADDR64 43 /* doubleword64 S + A */ #define R_PPC64_REL64 44 /* doubleword64 S + A - P */ #define R_PPC64_PLT64 45 /* doubleword64 L + A */ #define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */ #define R_PPC64_TOC16 47 /* half16* S + A - .TOC */ #define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */ #define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */ #define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */ #define R_PPC64_TOC 51 /* doubleword64 .TOC */ #define R_PPC64_PLTGOT16 52 /* half16* M + A */ #define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */ #define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */ #define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */ #define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */ #define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */ #define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */ #define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */ #define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */ #define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */ #define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */ #define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */ #define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */ #define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */ #define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */ /* PowerPC64 relocations defined for the TLS access ABI. */ #define R_PPC64_TLS 67 /* none (sym+add)@tls */ #define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */ #define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */ #define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ #define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ #define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ #define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */ #define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */ #define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ #define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ #define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ #define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */ #define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ #define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ #define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ #define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ #define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ #define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ #define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ #define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ #define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */ #define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */ #define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ #define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ #define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */ #define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */ #define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */ #define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */ #define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */ #define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */ #define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */ #define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */ #define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */ #define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */ #define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */ #define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */ #define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */ #define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ #define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ #define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ /* Keep this the last entry. */ #define R_PPC64_NUM 107 /* PowerPC64 specific values for the Dyn d_tag field. */ #define DT_PPC64_GLINK (DT_LOPROC + 0) #define DT_PPC64_OPD (DT_LOPROC + 1) #define DT_PPC64_OPDSZ (DT_LOPROC + 2) #define DT_PPC64_NUM 3 /* ARM specific declarations */ /* Processor specific flags for the ELF header e_flags field. */ #define EF_ARM_RELEXEC 0x01 #define EF_ARM_HASENTRY 0x02 #define EF_ARM_INTERWORK 0x04 #define EF_ARM_APCS_26 0x08 #define EF_ARM_APCS_FLOAT 0x10 #define EF_ARM_PIC 0x20 #define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */ #define EF_ARM_NEW_ABI 0x80 #define EF_ARM_OLD_ABI 0x100 /* Other constants defined in the ARM ELF spec. version B-01. */ /* NB. These conflict with values defined above. */ #define EF_ARM_SYMSARESORTED 0x04 #define EF_ARM_DYNSYMSUSESEGIDX 0x08 #define EF_ARM_MAPSYMSFIRST 0x10 #define EF_ARM_EABIMASK 0XFF000000 #define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) #define EF_ARM_EABI_UNKNOWN 0x00000000 #define EF_ARM_EABI_VER1 0x01000000 #define EF_ARM_EABI_VER2 0x02000000 /* Additional symbol types for Thumb */ #define STT_ARM_TFUNC 0xd /* ARM-specific values for sh_flags */ #define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */ #define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined in the input to a link step */ /* ARM-specific program header flags */ #define PF_ARM_SB 0x10000000 /* Segment contains the location addressed by the static base */ /* Processor specific values for the Phdr p_type field. */ #define PT_ARM_EXIDX 0x70000001 /* .ARM.exidx segment */ /* ARM relocs. */ #define R_ARM_NONE 0 /* No reloc */ #define R_ARM_PC24 1 /* PC relative 26 bit branch */ #define R_ARM_ABS32 2 /* Direct 32 bit */ #define R_ARM_REL32 3 /* PC relative 32 bit */ #define R_ARM_PC13 4 #define R_ARM_ABS16 5 /* Direct 16 bit */ #define R_ARM_ABS12 6 /* Direct 12 bit */ #define R_ARM_THM_ABS5 7 #define R_ARM_ABS8 8 /* Direct 8 bit */ #define R_ARM_SBREL32 9 #define R_ARM_THM_PC22 10 #define R_ARM_THM_PC8 11 #define R_ARM_AMP_VCALL9 12 #define R_ARM_SWI24 13 #define R_ARM_THM_SWI8 14 #define R_ARM_XPC25 15 #define R_ARM_THM_XPC22 16 #define R_ARM_TLS_DTPMOD32 17 #define R_ARM_TLS_DTPOFF32 18 #define R_ARM_TLS_TPOFF32 19 #define R_ARM_COPY 20 /* Copy symbol at runtime */ #define R_ARM_GLOB_DAT 21 /* Create GOT entry */ #define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ #define R_ARM_RELATIVE 23 /* Adjust by program base */ #define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ #define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ #define R_ARM_GOT32 26 /* 32 bit GOT entry */ #define R_ARM_PLT32 27 /* 32 bit PLT address */ #define R_ARM_ALU_PCREL_7_0 32 #define R_ARM_ALU_PCREL_15_8 33 #define R_ARM_ALU_PCREL_23_15 34 #define R_ARM_LDR_SBREL_11_0 35 #define R_ARM_ALU_SBREL_19_12 36 #define R_ARM_ALU_SBREL_27_20 37 #define R_ARM_GNU_VTENTRY 100 #define R_ARM_GNU_VTINHERIT 101 #define R_ARM_THM_PC11 102 /* thumb unconditional branch */ #define R_ARM_THM_PC9 103 /* thumb conditional branch */ #define R_ARM_TLS_GD32 104 #define R_ARM_TLS_LDM32 105 #define R_ARM_TLS_LDO32 106 #define R_ARM_TLS_IE32 107 #define R_ARM_TLS_LE32 108 #define R_ARM_TLS_LDO12 109 #define R_ARM_TLS_LE12 110 #define R_ARM_TLS_IE12GP 111 #define R_ARM_RXPC25 249 #define R_ARM_RSBREL32 250 #define R_ARM_THM_RPC22 251 #define R_ARM_RREL32 252 #define R_ARM_RABS22 253 #define R_ARM_RPC24 254 #define R_ARM_RBASE 255 /* Keep this the last entry. */ #define R_ARM_NUM 256 /* IA-64 specific declarations. */ /* Processor specific flags for the Ehdr e_flags field. */ #define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ #define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */ #define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ /* Processor specific values for the Phdr p_type field. */ #define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ #define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ #define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) #define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) #define PT_IA_64_HP_STACK (PT_LOOS + 0x14) /* Processor specific flags for the Phdr p_flags field. */ #define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */ /* Processor specific values for the Shdr sh_type field. */ #define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ /* Processor specific flags for the Shdr sh_flags field. */ #define SHF_IA_64_SHORT 0x10000000 /* section near gp */ #define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ /* Processor specific values for the Dyn d_tag field. */ #define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) #define DT_IA_64_NUM 1 /* IA-64 relocations. */ #define R_IA64_NONE 0x00 /* none */ #define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */ #define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */ #define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */ #define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */ #define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */ #define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */ #define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */ #define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */ #define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */ #define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */ #define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */ #define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */ #define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */ #define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */ #define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */ #define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */ #define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */ #define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */ #define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */ #define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */ #define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */ #define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */ #define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */ #define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */ #define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */ #define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */ #define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */ #define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */ #define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */ #define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */ #define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */ #define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */ #define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */ #define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */ #define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */ #define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */ #define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */ #define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */ #define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */ #define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */ #define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */ #define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */ #define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */ #define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */ #define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */ #define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */ #define R_IA64_REL32MSB 0x6c /* data 4 + REL */ #define R_IA64_REL32LSB 0x6d /* data 4 + REL */ #define R_IA64_REL64MSB 0x6e /* data 8 + REL */ #define R_IA64_REL64LSB 0x6f /* data 8 + REL */ #define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */ #define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */ #define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */ #define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */ #define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */ #define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */ #define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */ #define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */ #define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */ #define R_IA64_COPY 0x84 /* copy relocation */ #define R_IA64_SUB 0x85 /* Addend and symbol difference */ #define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */ #define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */ #define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */ #define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */ #define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */ #define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */ #define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */ #define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */ #define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */ #define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */ #define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */ #define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */ #define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */ #define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */ #define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */ #define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */ #define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */ #define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */ #define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */ /* SH specific declarations */ /* SH specific values for `st_other'. */ /* If set, this is a symbol pointing to SHmedia code, which will be branched to, so need to add 1 to the symbol value. */ #define STO_SH5_ISA32 (1 << 2) /* SH relocs. */ #define R_SH_NONE 0 #define R_SH_DIR32 1 #define R_SH_REL32 2 #define R_SH_DIR8WPN 3 #define R_SH_IND12W 4 #define R_SH_DIR8WPL 5 #define R_SH_DIR8WPZ 6 #define R_SH_DIR8BP 7 #define R_SH_DIR8W 8 #define R_SH_DIR8L 9 #define R_SH_SWITCH16 25 #define R_SH_SWITCH32 26 #define R_SH_USES 27 #define R_SH_COUNT 28 #define R_SH_ALIGN 29 #define R_SH_CODE 30 #define R_SH_DATA 31 #define R_SH_LABEL 32 #define R_SH_SWITCH8 33 #define R_SH_GNU_VTINHERIT 34 #define R_SH_GNU_VTENTRY 35 #define R_SH_TLS_GD_32 144 #define R_SH_TLS_LD_32 145 #define R_SH_TLS_LDO_32 146 #define R_SH_TLS_IE_32 147 #define R_SH_TLS_LE_32 148 #define R_SH_TLS_DTPMOD32 149 #define R_SH_TLS_DTPOFF32 150 #define R_SH_TLS_TPOFF32 151 #define R_SH_GOT32 160 #define R_SH_PLT32 161 #define R_SH_COPY 162 #define R_SH_GLOB_DAT 163 #define R_SH_JMP_SLOT 164 #define R_SH_RELATIVE 165 #define R_SH_GOTOFF 166 #define R_SH_GOTPC 167 #define R_SH_RELATIVE_LOW16 197 #define R_SH_RELATIVE_MEDLOW16 198 #define R_SH_IMM_LOW16 246 #define R_SH_IMM_LOW16_PCREL 247 #define R_SH_IMM_MEDLOW16 248 #define R_SH_IMM_MEDLOW16_PCREL 249 /* Keep this the last entry. */ #define R_SH_NUM 256 /* Additional s390 relocs */ #define R_390_NONE 0 /* No reloc. */ #define R_390_8 1 /* Direct 8 bit. */ #define R_390_12 2 /* Direct 12 bit. */ #define R_390_16 3 /* Direct 16 bit. */ #define R_390_32 4 /* Direct 32 bit. */ #define R_390_PC32 5 /* PC relative 32 bit. */ #define R_390_GOT12 6 /* 12 bit GOT offset. */ #define R_390_GOT32 7 /* 32 bit GOT offset. */ #define R_390_PLT32 8 /* 32 bit PC relative PLT address. */ #define R_390_COPY 9 /* Copy symbol at runtime. */ #define R_390_GLOB_DAT 10 /* Create GOT entry. */ #define R_390_JMP_SLOT 11 /* Create PLT entry. */ #define R_390_RELATIVE 12 /* Adjust by program base. */ #define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */ #define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */ #define R_390_GOT16 15 /* 16 bit GOT offset. */ #define R_390_PC16 16 /* PC relative 16 bit. */ #define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */ #define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */ #define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */ #define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */ #define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */ #define R_390_64 22 /* Direct 64 bit. */ #define R_390_PC64 23 /* PC relative 64 bit. */ #define R_390_GOT64 24 /* 64 bit GOT offset. */ #define R_390_PLT64 25 /* 64 bit PC relative PLT address. */ #define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */ #define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */ #define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */ #define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */ #define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */ #define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */ #define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */ #define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */ #define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */ #define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */ #define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */ #define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */ #define R_390_TLS_GDCALL 38 /* Tag for function call in general dynamic TLS code. */ #define R_390_TLS_LDCALL 39 /* Tag for function call in local dynamic TLS code. */ #define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic thread local data. */ #define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic thread local data. */ #define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS block offset. */ #define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS block offset. */ #define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS block offset. */ #define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic thread local data in LE code. */ #define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic thread local data in LE code. */ #define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for negated static TLS block offset. */ #define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for negated static TLS block offset. */ #define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for negated static TLS block offset. */ #define R_390_TLS_LE32 50 /* 32 bit negated offset relative to static TLS block. */ #define R_390_TLS_LE64 51 /* 64 bit negated offset relative to static TLS block. */ #define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS block. */ #define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS block. */ #define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */ #define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ #define R_390_TLS_TPOFF 56 /* Negated offset in static TLS block. */ #define R_390_20 57 /* Direct 20 bit. */ #define R_390_GOT20 58 /* 20 bit GOT offset. */ #define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ #define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS block offset. */ /* Keep this the last entry. */ #define R_390_NUM 61 /* CRIS flags. */ #define EF_CRIS_VARIANT_MASK 0x0000000e #define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000 #define EF_CRIS_VARIANT_V32 0x00000002 #define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004 /* CRIS relocations. */ #define R_CRIS_NONE 0 #define R_CRIS_8 1 #define R_CRIS_16 2 #define R_CRIS_32 3 #define R_CRIS_8_PCREL 4 #define R_CRIS_16_PCREL 5 #define R_CRIS_32_PCREL 6 #define R_CRIS_GNU_VTINHERIT 7 #define R_CRIS_GNU_VTENTRY 8 #define R_CRIS_COPY 9 #define R_CRIS_GLOB_DAT 10 #define R_CRIS_JUMP_SLOT 11 #define R_CRIS_RELATIVE 12 #define R_CRIS_16_GOT 13 #define R_CRIS_32_GOT 14 #define R_CRIS_16_GOTPLT 15 #define R_CRIS_32_GOTPLT 16 #define R_CRIS_32_GOTREL 17 #define R_CRIS_32_PLT_GOTREL 18 #define R_CRIS_32_PLT_PCREL 19 /* Keep this the last entry. */ #define R_CRIS_NUM 20 /* AMD x86-64 relocations. */ #define R_X86_64_NONE 0 /* No reloc */ #define R_X86_64_64 1 /* Direct 64 bit */ #define R_X86_64_PC32 2 /* PC relative 32 bit signed */ #define R_X86_64_GOT32 3 /* 32 bit GOT entry */ #define R_X86_64_PLT32 4 /* 32 bit PLT address */ #define R_X86_64_COPY 5 /* Copy symbol at runtime */ #define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ #define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ #define R_X86_64_RELATIVE 8 /* Adjust by program base */ #define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */ #define R_X86_64_32 10 /* Direct 32 bit zero extended */ #define R_X86_64_32S 11 /* Direct 32 bit sign extended */ #define R_X86_64_16 12 /* Direct 16 bit zero extended */ #define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ #define R_X86_64_8 14 /* Direct 8 bit sign extended */ #define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ #define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ #define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ #define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ #define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset to two GOT entries for GD symbol */ #define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset to two GOT entries for LD symbol */ #define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ #define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset to GOT entry for IE symbol */ #define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ #define R_X86_64_NUM 24 /* AM33 relocations. */ #define R_MN10300_NONE 0 /* No reloc. */ #define R_MN10300_32 1 /* Direct 32 bit. */ #define R_MN10300_16 2 /* Direct 16 bit. */ #define R_MN10300_8 3 /* Direct 8 bit. */ #define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ #define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ #define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ #define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ #define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ #define R_MN10300_24 9 /* Direct 24 bit. */ #define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ #define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ #define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ #define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ #define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ #define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ #define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ #define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ #define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ #define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ #define R_MN10300_COPY 20 /* Copy symbol at runtime. */ #define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ #define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ #define R_MN10300_RELATIVE 23 /* Adjust by program base. */ #define R_MN10300_NUM 24 /* M32R relocs. */ #define R_M32R_NONE 0 /* No reloc. */ #define R_M32R_16 1 /* Direct 16 bit. */ #define R_M32R_32 2 /* Direct 32 bit. */ #define R_M32R_24 3 /* Direct 24 bit. */ #define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ #define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ #define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ #define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ #define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ #define R_M32R_LO16 9 /* Low 16 bit. */ #define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ #define R_M32R_GNU_VTINHERIT 11 #define R_M32R_GNU_VTENTRY 12 /* M32R relocs use SHT_RELA. */ #define R_M32R_16_RELA 33 /* Direct 16 bit. */ #define R_M32R_32_RELA 34 /* Direct 32 bit. */ #define R_M32R_24_RELA 35 /* Direct 24 bit. */ #define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ #define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ #define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ #define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ #define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ #define R_M32R_LO16_RELA 41 /* Low 16 bit */ #define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ #define R_M32R_RELA_GNU_VTINHERIT 43 #define R_M32R_RELA_GNU_VTENTRY 44 #define R_M32R_GOT24 48 /* 24 bit GOT entry */ #define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ #define R_M32R_COPY 50 /* Copy symbol at runtime */ #define R_M32R_GLOB_DAT 51 /* Create GOT entry */ #define R_M32R_JMP_SLOT 52 /* Create PLT entry */ #define R_M32R_RELATIVE 53 /* Adjust by program base */ #define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ #define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ #define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned low */ #define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed low */ #define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ #define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to GOT with unsigned low */ #define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to GOT with signed low */ #define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to GOT */ #define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT with unsigned low */ #define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT with signed low */ #define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ #define R_M32R_NUM 256 /* Keep this the last entry. */ /* i960 Relocations */ #define R_960_NONE 0 #define R_960_12 1 #define R_960_32 2 #define R_960_IP24 3 #define R_960_SUB 4 #define R_960_OPTCALL 5 #define R_960_OPTCALLX 6 #define R_960_OPTCALLXA 7 /* Keep this the last entry. */ #define R_960_NUM 8 /* v850 relocations. */ #define R_V850_NONE 0 #define R_V850_9_PCREL 1 #define R_V850_22_PCREL 2 #define R_V850_HI16_S 3 #define R_V850_HI16 4 #define R_V850_LO16 5 #define R_V850_32 6 #define R_V850_16 7 #define R_V850_8 8 #define R_V850_SDA_16_16_OFFSET 9 /* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */ #define R_V850_SDA_15_16_OFFSET 10 /* For ld.w, ld.h, ld.hu, st.w, st.h */ #define R_V850_ZDA_16_16_OFFSET 11 /* For ld.b, st.b, set1, clr1, not1, tst1, movea, movhi */ #define R_V850_ZDA_15_16_OFFSET 12 /* For ld.w, ld.h, ld.hu, st.w, st.h */ #define R_V850_TDA_6_8_OFFSET 13 /* For sst.w, sld.w */ #define R_V850_TDA_7_8_OFFSET 14 /* For sst.h, sld.h */ #define R_V850_TDA_7_7_OFFSET 15 /* For sst.b, sld.b */ #define R_V850_TDA_16_16_OFFSET 16 /* For set1, clr1, not1, tst1, movea, movhi */ /* CYGNUS LOCAL v850e */ #define R_V850_TDA_4_5_OFFSET 17 /* For sld.hu */ #define R_V850_TDA_4_4_OFFSET 18 /* For sld.bu */ #define R_V850_SDA_16_16_SPLIT_OFFSET 19 /* For ld.bu */ #define R_V850_ZDA_16_16_SPLIT_OFFSET 20 /* For ld.bu */ #define R_V850_CALLT_6_7_OFFSET 21 /* For callt */ #define R_V850_CALLT_16_16_OFFSET 22 /* For callt */ /* END CYGNUS LOCAL */ #define R_V850_GNU_VTINHERIT 23 #define R_V850_GNU_VTENTRY 24 /* Keep this the last entry. */ #define R_V850_NUM 25 /* Atmel AVR32 relocations. */ #define R_AVR32_NONE 0 #define R_AVR32_32 1 #define R_AVR32_16 2 #define R_AVR32_8 3 #define R_AVR32_32_PCREL 4 #define R_AVR32_16_PCREL 5 #define R_AVR32_8_PCREL 6 #define R_AVR32_DIFF32 7 #define R_AVR32_DIFF16 8 #define R_AVR32_DIFF8 9 #define R_AVR32_GOT32 10 #define R_AVR32_GOT16 11 #define R_AVR32_GOT8 12 #define R_AVR32_21S 13 #define R_AVR32_16U 14 #define R_AVR32_16S 15 #define R_AVR32_8S 16 #define R_AVR32_8S_EXT 17 #define R_AVR32_22H_PCREL 18 #define R_AVR32_18W_PCREL 19 #define R_AVR32_16B_PCREL 20 #define R_AVR32_16N_PCREL 21 #define R_AVR32_14UW_PCREL 22 #define R_AVR32_11H_PCREL 23 #define R_AVR32_10UW_PCREL 24 #define R_AVR32_9H_PCREL 25 #define R_AVR32_9UW_PCREL 26 #define R_AVR32_HI16 27 #define R_AVR32_LO16 28 #define R_AVR32_GOTPC 29 #define R_AVR32_GOTCALL 30 #define R_AVR32_LDA_GOT 31 #define R_AVR32_GOT21S 32 #define R_AVR32_GOT18SW 33 #define R_AVR32_GOT16S 34 #define R_AVR32_GOT7UW 35 #define R_AVR32_32_CPENT 36 #define R_AVR32_CPCALL 37 #define R_AVR32_16_CP 38 #define R_AVR32_9W_CP 39 #define R_AVR32_RELATIVE 40 #define R_AVR32_GLOB_DAT 41 #define R_AVR32_JMP_SLOT 42 #define R_AVR32_ALIGN 43 #define R_AVR32_NUM 44 /* AVR32 dynamic tags */ #define DT_AVR32_GOTSZ 0x70000001 /* Total size of GOT in bytes */ /* Renesas H8/300 Relocations */ #define R_H8_NONE 0 #define R_H8_DIR32 1 #define R_H8_DIR32_28 2 #define R_H8_DIR32_24 3 #define R_H8_DIR32_16 4 #define R_H8_DIR32U 6 #define R_H8_DIR32U_28 7 #define R_H8_DIR32U_24 8 #define R_H8_DIR32U_20 9 #define R_H8_DIR32U_16 10 #define R_H8_DIR24 11 #define R_H8_DIR24_20 12 #define R_H8_DIR24_16 13 #define R_H8_DIR24U 14 #define R_H8_DIR24U_20 15 #define R_H8_DIR24U_16 16 #define R_H8_DIR16 17 #define R_H8_DIR16U 18 #define R_H8_DIR16S_32 19 #define R_H8_DIR16S_28 20 #define R_H8_DIR16S_24 21 #define R_H8_DIR16S_20 22 #define R_H8_DIR16S 23 #define R_H8_DIR8 24 #define R_H8_DIR8U 25 #define R_H8_DIR8Z_32 26 #define R_H8_DIR8Z_28 27 #define R_H8_DIR8Z_24 28 #define R_H8_DIR8Z_20 29 #define R_H8_DIR8Z_16 30 #define R_H8_PCREL16 31 #define R_H8_PCREL8 32 #define R_H8_BPOS 33 #define R_H8_PCREL32 34 #define R_H8_GOT32O 35 #define R_H8_GOT16O 36 #define R_H8_DIR16A8 59 #define R_H8_DIR16R8 60 #define R_H8_DIR24A8 61 #define R_H8_DIR24R8 62 #define R_H8_DIR32A16 63 #define R_H8_ABS32 65 #define R_H8_ABS32A16 127 #define R_H8_NUM 128 /* NIOS relocations. */ #define R_NIOS_NONE 0 #define R_NIOS_32 1 /* A 32 bit absolute relocation.*/ #define R_NIOS_LO16_LO5 2 /* A LO-16 5 bit absolute relocation. */ #define R_NIOS_LO16_HI11 3 /* A LO-16 top 11 bit absolute relocation. */ #define R_NIOS_HI16_LO5 4 /* A HI-16 5 bit absolute relocation. */ #define R_NIOS_HI16_HI11 5 /* A HI-16 top 11 bit absolute relocation. */ #define R_NIOS_PCREL6 6 /* A 6 bit relative relocation. */ #define R_NIOS_PCREL8 7 /* An 8 bit relative relocation. */ #define R_NIOS_PCREL11 8 /* An 11 bit relative relocation. */ #define R_NIOS_16 9 /* A 16 bit absolute relocation. */ #define R_NIOS_H_LO5 10 /* Low 5-bits of absolute relocation in halfwords. */ #define R_NIOS_H_HI11 11 /* Top 11 bits of 16-bit absolute relocation in halfwords. */ #define R_NIOS_H_XLO5 12 /* Low 5 bits of top 16-bits of 32-bit absolute relocation in halfwords. */ #define R_NIOS_H_XHI11 13 /* Top 11 bits of top 16-bits of 32-bit absolute relocation in halfwords. */ #define R_NIOS_H_16 14 /* Half-word @h value */ #define R_NIOS_H_32 15 /* Word @h value */ #define R_NIOS_GNU_VTINHERIT 200 /* GNU extension to record C++ vtable hierarchy */ #define R_NIOS_GNU_VTENTRY 201 /* GNU extension to record C++ vtable member usage */ /* Keep this the last entry. */ #define R_NIOS_NUM 202 /* NIOS II relocations */ #define R_NIOS2_NONE 0 #define R_NIOS2_S16 1 #define R_NIOS2_U16 2 #define R_NIOS2_PCREL16 3 #define R_NIOS2_CALL26 4 #define R_NIOS2_IMM5 5 #define R_NIOS2_CACHE_OPX 6 #define R_NIOS2_IMM6 7 #define R_NIOS2_IMM8 8 #define R_NIOS2_HI16 9 #define R_NIOS2_LO16 10 #define R_NIOS2_HIADJ16 11 #define R_NIOS2_BFD_RELOC_32 12 #define R_NIOS2_BFD_RELOC_16 13 #define R_NIOS2_BFD_RELOC_8 14 #define R_NIOS2_GPREL 15 #define R_NIOS2_GNU_VTINHERIT 16 #define R_NIOS2_GNU_VTENTRY 17 #define R_NIOS2_UJMP 18 #define R_NIOS2_CJMP 19 #define R_NIOS2_CALLR 20 #define R_NIOS2_ALIGN 21 /* Keep this the last entry. */ #define R_NIOS2_NUM 22 /* Xtensa-specific declarations */ /* Xtensa values for the Dyn d_tag field. */ #define DT_XTENSA_GOT_LOC_OFF (DT_LOPROC + 0) #define DT_XTENSA_GOT_LOC_SZ (DT_LOPROC + 1) #define DT_XTENSA_NUM 2 /* Xtensa relocations. */ #define R_XTENSA_NONE 0 #define R_XTENSA_32 1 #define R_XTENSA_RTLD 2 #define R_XTENSA_GLOB_DAT 3 #define R_XTENSA_JMP_SLOT 4 #define R_XTENSA_RELATIVE 5 #define R_XTENSA_PLT 6 #define R_XTENSA_OP0 8 #define R_XTENSA_OP1 9 #define R_XTENSA_OP2 10 #define R_XTENSA_ASM_EXPAND 11 #define R_XTENSA_ASM_SIMPLIFY 12 #define R_XTENSA_GNU_VTINHERIT 15 #define R_XTENSA_GNU_VTENTRY 16 #define R_XTENSA_DIFF8 17 #define R_XTENSA_DIFF16 18 #define R_XTENSA_DIFF32 19 #define R_XTENSA_SLOT0_OP 20 #define R_XTENSA_SLOT1_OP 21 #define R_XTENSA_SLOT2_OP 22 #define R_XTENSA_SLOT3_OP 23 #define R_XTENSA_SLOT4_OP 24 #define R_XTENSA_SLOT5_OP 25 #define R_XTENSA_SLOT6_OP 26 #define R_XTENSA_SLOT7_OP 27 #define R_XTENSA_SLOT8_OP 28 #define R_XTENSA_SLOT9_OP 29 #define R_XTENSA_SLOT10_OP 30 #define R_XTENSA_SLOT11_OP 31 #define R_XTENSA_SLOT12_OP 32 #define R_XTENSA_SLOT13_OP 33 #define R_XTENSA_SLOT14_OP 34 #define R_XTENSA_SLOT0_ALT 35 #define R_XTENSA_SLOT1_ALT 36 #define R_XTENSA_SLOT2_ALT 37 #define R_XTENSA_SLOT3_ALT 38 #define R_XTENSA_SLOT4_ALT 39 #define R_XTENSA_SLOT5_ALT 40 #define R_XTENSA_SLOT6_ALT 41 #define R_XTENSA_SLOT7_ALT 42 #define R_XTENSA_SLOT8_ALT 43 #define R_XTENSA_SLOT9_ALT 44 #define R_XTENSA_SLOT10_ALT 45 #define R_XTENSA_SLOT11_ALT 46 #define R_XTENSA_SLOT12_ALT 47 #define R_XTENSA_SLOT13_ALT 48 #define R_XTENSA_SLOT14_ALT 49 /* Keep this the last entry. */ #define R_XTENSA_NUM 50 #ifdef __cplusplus } #endif #endif /* elf.h */ /* Definitions for GNU multiple precision functions. -*- mode: c -*- Copyright 1991, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU MP Library. The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ #ifndef __GMP_H__ #if defined (__cplusplus) #include /* for std::istream, std::ostream, std::string */ #include #endif /* Instantiated by configure. */ #if ! defined (__GMP_WITHIN_CONFIGURE) #define __GMP_HAVE_HOST_CPU_FAMILY_power 0 #define __GMP_HAVE_HOST_CPU_FAMILY_powerpc 0 #define GMP_LIMB_BITS 32 #define GMP_NAIL_BITS 0 #endif #define GMP_NUMB_BITS (GMP_LIMB_BITS - GMP_NAIL_BITS) #define GMP_NUMB_MASK ((~ __GMP_CAST (mp_limb_t, 0)) >> GMP_NAIL_BITS) #define GMP_NUMB_MAX GMP_NUMB_MASK #define GMP_NAIL_MASK (~ GMP_NUMB_MASK) /* The following (everything under ifndef __GNU_MP__) must be identical in gmp.h and mp.h to allow both to be included in an application or during the library build. */ #ifndef __GNU_MP__ #define __GNU_MP__ 5 #define __need_size_t /* tell gcc stddef.h we only want size_t */ #if defined (__cplusplus) #include /* for size_t */ #else #include /* for size_t */ #endif #undef __need_size_t /* Instantiated by configure. */ #if ! defined (__GMP_WITHIN_CONFIGURE) /* #undef _LONG_LONG_LIMB */ #define __GMP_LIBGMP_DLL 0 #endif /* __STDC__ - some ANSI compilers define this only to 0, hence the use of "defined" and not "__STDC__-0". In particular Sun workshop C 5.0 sets __STDC__ to 0, but requires "##" for token pasting. _AIX - gnu ansidecl.h asserts that all known AIX compilers are ANSI but don't always define __STDC__. __DECC - current versions of DEC C (5.9 for instance) for alpha are ANSI, but don't define __STDC__ in their default mode. Don't know if old versions might have been K&R, but let's not worry about that unless someone is still using one. _mips - gnu ansidecl.h says the RISC/OS MIPS compiler is ANSI in SVR4 mode, but doesn't define __STDC__. _MSC_VER - Microsoft C is ANSI, but __STDC__ is undefined unless the /Za option is given (in which case it's 1). _WIN32 - tested for by gnu ansidecl.h, no doubt on the assumption that all w32 compilers are ansi. Note: This same set of tests is used by gen-psqr.c and demos/expr/expr-impl.h, so if anything needs adding, then be sure to update those too. */ #if defined (__STDC__) \ || defined (__cplusplus) \ || defined (_AIX) \ || defined (__DECC) \ || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ || defined (_MSC_VER) \ || defined (_WIN32) #define __GMP_HAVE_CONST 1 #define __GMP_HAVE_PROTOTYPES 1 #define __GMP_HAVE_TOKEN_PASTE 1 #else #define __GMP_HAVE_CONST 0 #define __GMP_HAVE_PROTOTYPES 0 #define __GMP_HAVE_TOKEN_PASTE 0 #endif #if __GMP_HAVE_CONST #define __gmp_const const #define __gmp_signed signed #else #define __gmp_const #define __gmp_signed #endif /* __GMP_DECLSPEC supports Windows DLL versions of libgmp, and is empty in all other circumstances. When compiling objects for libgmp, __GMP_DECLSPEC is an export directive, or when compiling for an application it's an import directive. The two cases are differentiated by __GMP_WITHIN_GMP defined by the GMP Makefiles (and not defined from an application). __GMP_DECLSPEC_XX is similarly used for libgmpxx. __GMP_WITHIN_GMPXX indicates when building libgmpxx, and in that case libgmpxx functions are exports, but libgmp functions which might get called are imports. libmp.la uses __GMP_DECLSPEC, just as if it were libgmp.la. libgmp and libmp don't call each other, so there's no conflict or confusion. Libtool DLL_EXPORT define is not used. There's no attempt to support GMP built both static and DLL. Doing so would mean applications would have to tell us which of the two is going to be used when linking, and that seems very tedious and error prone if using GMP by hand, and equally tedious from a package since autoconf and automake don't give much help. __GMP_DECLSPEC is required on all documented global functions and variables, the various internals in gmp-impl.h etc can be left unadorned. But internals used by the test programs or speed measuring programs should have __GMP_DECLSPEC, and certainly constants or variables must have it or the wrong address will be resolved. In gcc __declspec can go at either the start or end of a prototype. In Microsoft C __declspec must go at the start, or after the type like void __declspec(...) *foo()". There's no __dllexport or anything to guard against someone foolish #defining dllexport. _export used to be available, but no longer. In Borland C _export still exists, but needs to go after the type, like "void _export foo();". Would have to change the __GMP_DECLSPEC syntax to make use of that. Probably more trouble than it's worth. */ #if defined (__GNUC__) #define __GMP_DECLSPEC_EXPORT __declspec(__dllexport__) #define __GMP_DECLSPEC_IMPORT __declspec(__dllimport__) #endif #if defined (_MSC_VER) || defined (__BORLANDC__) #define __GMP_DECLSPEC_EXPORT __declspec(dllexport) #define __GMP_DECLSPEC_IMPORT __declspec(dllimport) #endif #ifdef __WATCOMC__ #define __GMP_DECLSPEC_EXPORT __export #define __GMP_DECLSPEC_IMPORT __import #endif #ifdef __IBMC__ #define __GMP_DECLSPEC_EXPORT _Export #define __GMP_DECLSPEC_IMPORT _Import #endif #if __GMP_LIBGMP_DLL #if __GMP_WITHIN_GMP /* compiling to go into a DLL libgmp */ #define __GMP_DECLSPEC __GMP_DECLSPEC_EXPORT #else /* compiling to go into an application which will link to a DLL libgmp */ #define __GMP_DECLSPEC __GMP_DECLSPEC_IMPORT #endif #else /* all other cases */ #define __GMP_DECLSPEC #endif #ifdef __GMP_SHORT_LIMB typedef unsigned int mp_limb_t; typedef int mp_limb_signed_t; #else #ifdef _LONG_LONG_LIMB typedef unsigned long long int mp_limb_t; typedef long long int mp_limb_signed_t; #else typedef unsigned long int mp_limb_t; typedef long int mp_limb_signed_t; #endif #endif typedef unsigned long int mp_bitcnt_t; /* For reference, note that the name __mpz_struct gets into C++ mangled function names, which means although the "__" suggests an internal, we must leave this name for binary compatibility. */ typedef struct { int _mp_alloc; /* Number of *limbs* allocated and pointed to by the _mp_d field. */ int _mp_size; /* abs(_mp_size) is the number of limbs the last field points to. If _mp_size is negative this is a negative number. */ mp_limb_t *_mp_d; /* Pointer to the limbs. */ } __mpz_struct; #endif /* __GNU_MP__ */ typedef __mpz_struct MP_INT; /* gmp 1 source compatibility */ typedef __mpz_struct mpz_t[1]; typedef mp_limb_t * mp_ptr; typedef __gmp_const mp_limb_t * mp_srcptr; #if defined (_CRAY) && ! defined (_CRAYMPP) /* plain `int' is much faster (48 bits) */ #define __GMP_MP_SIZE_T_INT 1 typedef int mp_size_t; typedef int mp_exp_t; #else #define __GMP_MP_SIZE_T_INT 0 typedef long int mp_size_t; typedef long int mp_exp_t; #endif typedef struct { __mpz_struct _mp_num; __mpz_struct _mp_den; } __mpq_struct; typedef __mpq_struct MP_RAT; /* gmp 1 source compatibility */ typedef __mpq_struct mpq_t[1]; typedef struct { int _mp_prec; /* Max precision, in number of `mp_limb_t's. Set by mpf_init and modified by mpf_set_prec. The area pointed to by the _mp_d field contains `prec' + 1 limbs. */ int _mp_size; /* abs(_mp_size) is the number of limbs the last field points to. If _mp_size is negative this is a negative number. */ mp_exp_t _mp_exp; /* Exponent, in the base of `mp_limb_t'. */ mp_limb_t *_mp_d; /* Pointer to the limbs. */ } __mpf_struct; /* typedef __mpf_struct MP_FLOAT; */ typedef __mpf_struct mpf_t[1]; /* Available random number generation algorithms. */ typedef enum { GMP_RAND_ALG_DEFAULT = 0, GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT /* Linear congruential. */ } gmp_randalg_t; /* Random state struct. */ typedef struct { mpz_t _mp_seed; /* _mp_d member points to state of the generator. */ gmp_randalg_t _mp_alg; /* Currently unused. */ union { void *_mp_lc; /* Pointer to function pointers structure. */ } _mp_algdata; } __gmp_randstate_struct; typedef __gmp_randstate_struct gmp_randstate_t[1]; /* Types for function declarations in gmp files. */ /* ??? Should not pollute user name space with these ??? */ typedef __gmp_const __mpz_struct *mpz_srcptr; typedef __mpz_struct *mpz_ptr; typedef __gmp_const __mpf_struct *mpf_srcptr; typedef __mpf_struct *mpf_ptr; typedef __gmp_const __mpq_struct *mpq_srcptr; typedef __mpq_struct *mpq_ptr; /* This is not wanted in mp.h, so put it outside the __GNU_MP__ common section. */ #if __GMP_LIBGMP_DLL #if __GMP_WITHIN_GMPXX /* compiling to go into a DLL libgmpxx */ #define __GMP_DECLSPEC_XX __GMP_DECLSPEC_EXPORT #else /* compiling to go into a application which will link to a DLL libgmpxx */ #define __GMP_DECLSPEC_XX __GMP_DECLSPEC_IMPORT #endif #else /* all other cases */ #define __GMP_DECLSPEC_XX #endif #if __GMP_HAVE_PROTOTYPES #define __GMP_PROTO(x) x #else #define __GMP_PROTO(x) () #endif #ifndef __MPN #if __GMP_HAVE_TOKEN_PASTE #define __MPN(x) __gmpn_##x #else #define __MPN(x) __gmpn_/**/x #endif #endif /* For reference, "defined(EOF)" cannot be used here. In g++ 2.95.4, defines EOF but not FILE. */ #if defined (FILE) \ || defined (H_STDIO) \ || defined (_H_STDIO) /* AIX */ \ || defined (_STDIO_H) /* glibc, Sun, SCO */ \ || defined (_STDIO_H_) /* BSD, OSF */ \ || defined (__STDIO_H) /* Borland */ \ || defined (__STDIO_H__) /* IRIX */ \ || defined (_STDIO_INCLUDED) /* HPUX */ \ || defined (__dj_include_stdio_h_) /* DJGPP */ \ || defined (_FILE_DEFINED) /* Microsoft */ \ || defined (__STDIO__) /* Apple MPW MrC */ \ || defined (_MSL_STDIO_H) /* Metrowerks */ \ || defined (_STDIO_H_INCLUDED) /* QNX4 */ \ || defined (_ISO_STDIO_ISO_H) /* Sun C++ */ #define _GMP_H_HAVE_FILE 1 #endif /* In ISO C, if a prototype involving "struct obstack *" is given without that structure defined, then the struct is scoped down to just the prototype, causing a conflict if it's subsequently defined for real. So only give prototypes if we've got obstack.h. */ #if defined (_OBSTACK_H) /* glibc */ #define _GMP_H_HAVE_OBSTACK 1 #endif /* The prototypes for gmp_vprintf etc are provided only if va_list is available, via an application having included or . Usually va_list is a typedef so can't be tested directly, but C99 specifies that va_start is a macro (and it was normally a macro on past systems too), so look for that. will define some sort of va_list for vprintf and vfprintf, but let's not bother trying to use that since it's not standard and since application uses for gmp_vprintf etc will almost certainly r´´µ´¶´·´¸´¹´º´»´¼´½´¾´¿´À´Á´Â´Ã´Ä´Å´Æ´Ç´È´É´Ê´Ë´Ì´Í´Î´Ï´Ð´Ñ´Ò´Ó´Ô´Õ´Ö´×´Ø´Ù´Ú´Û´Ü´Ý´Þ´ß´à´á´â´ã´ä´å´æ´ç´è´é´ê´ë´ì´í´î´ï´ð´ñ´ò´ó´ô´õ´ö´÷´ø´ù´ú´û´ü´equire the whole or anyway. */ #ifdef va_start #define _GMP_H_HAVE_VA_LIST 1 #endif /* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */ #if defined (__GNUC__) && defined (__GNUC_MINOR__) #define __GMP_GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) #else #define __GMP_GNUC_PREREQ(maj, min) 0 #endif /* "pure" is in gcc 2.96 and up, see "(gcc)Function Attributes". Basically it means a function does nothing but examine its arguments and memory (global or via arguments) to generate a return value, but changes nothing and has no side-effects. __GMP_NO_ATTRIBUTE_CONST_PURE lets tune/common.c etc turn this off when trying to write timing loops. */ #if __GMP_GNUC_PREREQ (2,96) && ! defined (__GMP_NO_ATTRIBUTE_CONST_PURE) #define __GMP_ATTRIBUTE_PURE __attribute__ ((__pure__)) #else #define __GMP_ATTRIBUTE_PURE #endif /* __GMP_CAST allows us to use static_cast in C++, so our macros are clean to "g++ -Wold-style-cast". Casts in "extern inline" code within an extern "C" block don't induce these warnings, so __GMP_CAST only needs to be used on documented macros. */ #ifdef __cplusplus #define __GMP_CAST(type, expr) (static_cast (expr)) #else #define __GMP_CAST(type, expr) ((type) (expr)) #endif /* An empty "throw ()" means the function doesn't throw any C++ exceptions, this can save some stack frame info in applications. Currently it's given only on functions which never divide-by-zero etc, don't allocate memory, and are expected to never need to allocate memory. This leaves open the possibility of a C++ throw from a future GMP exceptions scheme. mpz_set_ui etc are omitted to leave open the lazy allocation scheme described in doc/tasks.html. mpz_get_d etc are omitted to leave open exceptions for float overflows. Note that __GMP_NOTHROW must be given on any inlines the same as on their prototypes (for g++ at least, where they're used together). Note also that g++ 3.0 demands that __GMP_NOTHROW is before other attributes like __GMP_ATTRIBUTE_PURE. */ #if defined (__cplusplus) #define __GMP_NOTHROW throw () #else #define __GMP_NOTHROW #endif /* PORTME: What other compilers have a useful "extern inline"? "static inline" would be an acceptable substitute if the compiler (or linker) discards unused statics. */ /* gcc has __inline__ in all modes, including strict ansi. Give a prototype for an inline too, so as to correctly specify "dllimport" on windows, in case the function is called rather than inlined. GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 inline semantics, unless -fgnu89-inline is used. */ #ifdef __GNUC__ #if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ == 2) #define __GMP_EXTERN_INLINE extern __inline__ __attribute__ ((__gnu_inline__)) #else #define __GMP_EXTERN_INLINE extern __inline__ #endif #define __GMP_INLINE_PROTOTYPES 1 #endif /* DEC C (eg. version 5.9) supports "static __inline foo()", even in -std1 strict ANSI mode. Inlining is done even when not optimizing (ie. -O0 mode, which is the default), but an unnecessary local copy of foo is emitted unless -O is used. "extern __inline" is accepted, but the "extern" appears to be ignored, ie. it becomes a plain global function but which is inlined within its file. Don't know if all old versions of DEC C supported __inline, but as a start let's do the right thing for current versions. */ #ifdef __DECC #define __GMP_EXTERN_INLINE static __inline #endif /* SCO OpenUNIX 8 cc supports "static inline foo()" but not in -Xc strict ANSI mode (__STDC__ is 1 in that mode). Inlining only actually takes place under -O. Without -O "foo" seems to be emitted whether it's used or not, which is wasteful. "extern inline foo()" isn't useful, the "extern" is apparently ignored, so foo is inlined if possible but also emitted as a global, which causes multiple definition errors when building a shared libgmp. */ #ifdef __SCO_VERSION__ #if __SCO_VERSION__ > 400000000 && __STDC__ != 1 \ && ! defined (__GMP_EXTERN_INLINE) #define __GMP_EXTERN_INLINE static inline #endif #endif /* Microsoft's C compiler accepts __inline */ #ifdef _MSC_VER #define __GMP_EXTERN_INLINE __inline #endif /* Recent enough Sun C compilers want "inline" */ #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x560 \ && ! defined (__GMP_EXTERN_INLINE) #define __GMP_EXTERN_INLINE inline #endif /* Somewhat older Sun C compilers want "static inline" */ #if defined (__SUNPRO_C) && __SUNPRO_C >= 0x540 \ && ! defined (__GMP_EXTERN_INLINE) #define __GMP_EXTERN_INLINE static inline #endif /* C++ always has "inline" and since it's a normal feature the linker should discard duplicate non-inlined copies, or if it doesn't then that's a problem for everyone, not just GMP. */ #if defined (__cplusplus) && ! defined (__GMP_EXTERN_INLINE) #define __GMP_EXTERN_INLINE inline #endif /* Don't do any inlining within a configure run, since if the compiler ends up emitting copies of the code into the object file it can end up demanding the various support routines (like mpn_popcount) for linking, making the "alloca" test and perhaps others fail. And on hppa ia64 a pre-release gcc 3.2 was seen not respecting the "extern" in "extern __inline__", triggering this problem too. */ #if defined (__GMP_WITHIN_CONFIGURE) && ! __GMP_WITHIN_CONFIGURE_INLINE #undef __GMP_EXTERN_INLINE #endif /* By default, don't give a prototype when there's going to be an inline version. Note in particular that Cray C++ objects to the combination of prototype and inline. */ #ifdef __GMP_EXTERN_INLINE #ifndef __GMP_INLINE_PROTOTYPES #define __GMP_INLINE_PROTOTYPES 0 #endif #else #define __GMP_INLINE_PROTOTYPES 1 #endif #define __GMP_ABS(x) ((x) >= 0 ? (x) : -(x)) #define __GMP_MAX(h,i) ((h) > (i) ? (h) : (i)) /* __GMP_USHRT_MAX is not "~ (unsigned short) 0" because short is promoted to int by "~". */ #define __GMP_UINT_MAX (~ (unsigned) 0) #define __GMP_ULONG_MAX (~ (unsigned long) 0) #define __GMP_USHRT_MAX ((unsigned short) ~0) /* __builtin_expect is in gcc 3.0, and not in 2.95. */ #if __GMP_GNUC_PREREQ (3,0) #define __GMP_LIKELY(cond) __builtin_expect ((cond) != 0, 1) #define __GMP_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0) #else #define __GMP_LIKELY(cond) (cond) #define __GMP_UNLIKELY(cond) (cond) #endif #ifdef _CRAY #define __GMP_CRAY_Pragma(str) _Pragma (str) #else #define __GMP_CRAY_Pragma(str) #endif /* Allow direct user access to numerator and denominator of a mpq_t object. */ #define mpq_numref(Q) (&((Q)->_mp_num)) #define mpq_denref(Q) (&((Q)->_mp_den)) #if defined (__cplusplus) extern "C" { using std::FILE; #endif #define mp_set_memory_functions __gmp_set_memory_functions __GMP_DECLSPEC void mp_set_memory_functions __GMP_PROTO ((void *(*) (size_t), void *(*) (void *, size_t, size_t), void (*) (void *, size_t))) __GMP_NOTHROW; #define mp_get_memory_functions __gmp_get_memory_functions __GMP_DECLSPEC void mp_get_memory_functions __GMP_PROTO ((void *(**) (size_t), void *(**) (void *, size_t, size_t), void (**) (void *, size_t))) __GMP_NOTHROW; #define mp_bits_per_limb __gmp_bits_per_limb __GMP_DECLSPEC extern __gmp_const int mp_bits_per_limb; #define gmp_errno __gmp_errno __GMP_DECLSPEC extern int gmp_errno; #define gmp_version __gmp_version __GMP_DECLSPEC extern __gmp_const char * __gmp_const gmp_version; /**************** Random number routines. ****************/ /* obsolete */ #define gmp_randinit __gmp_randinit __GMP_DECLSPEC void gmp_randinit __GMP_PROTO ((gmp_randstate_t, gmp_randalg_t, ...)); #define gmp_randinit_default __gmp_randinit_default __GMP_DECLSPEC void gmp_randinit_default __GMP_PROTO ((gmp_randstate_t)); #define gmp_randinit_lc_2exp __gmp_randinit_lc_2exp __GMP_DECLSPEC void gmp_randinit_lc_2exp __GMP_PROTO ((gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t)); #define gmp_randinit_lc_2exp_size __gmp_randinit_lc_2exp_size __GMP_DECLSPEC int gmp_randinit_lc_2exp_size __GMP_PROTO ((gmp_randstate_t, mp_bitcnt_t)); #define gmp_randinit_mt __gmp_randinit_mt __GMP_DECLSPEC void gmp_randinit_mt __GMP_PROTO ((gmp_randstate_t)); #define gmp_randinit_set __gmp_randinit_set __GMP_DECLSPEC void gmp_randinit_set __GMP_PROTO ((gmp_randstate_t, __gmp_const __gmp_randstate_struct *)); #define gmp_randseed __gmp_randseed __GMP_DECLSPEC void gmp_randseed __GMP_PROTO ((gmp_randstate_t, mpz_srcptr)); #define gmp_randseed_ui __gmp_randseed_ui __GMP_DECLSPEC void gmp_randseed_ui __GMP_PROTO ((gmp_randstate_t, unsigned long int)); #define gmp_randclear __gmp_randclear __GMP_DECLSPEC void gmp_randclear __GMP_PROTO ((gmp_randstate_t)); #define gmp_urandomb_ui __gmp_urandomb_ui __GMP_DECLSPEC unsigned long gmp_urandomb_ui __GMP_PROTO ((gmp_randstate_t, unsigned long)); #define gmp_urandomm_ui __gmp_urandomm_ui __GMP_DECLSPEC unsigned long gmp_urandomm_ui __GMP_PROTO ((gmp_randstate_t, unsigned long)); /**************** Formatted output routines. ****************/ #define gmp_asprintf __gmp_asprintf __GMP_DECLSPEC int gmp_asprintf __GMP_PROTO ((char **, __gmp_const char *, ...)); #define gmp_fprintf __gmp_fprintf #ifdef _GMP_H_HAVE_FILE __GMP_DECLSPEC int gmp_fprintf __GMP_PROTO ((FILE *, __gmp_const char *, ...)); #endif #define gmp_obstack_printf __gmp_obstack_printf #if defined (_GMP_H_HAVE_OBSTACK) __GMP_DECLSPEC int gmp_obstack_printf __GMP_PROTO ((struct obstack *, __gmp_const char *, ...)); #endif #define gmp_obstack_vprintf __gmp_obstack_vprintf #if defined (_GMP_H_HAVE_OBSTACK) && defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_obstack_vprintf __GMP_PROTO ((struct obstack *, __gmp_const char *, va_list)); #endif #define gmp_printf __gmp_printf __GMP_DECLSPEC int gmp_printf __GMP_PROTO ((__gmp_const char *, ...)); #define gmp_snprintf __gmp_snprintf __GMP_DECLSPEC int gmp_snprintf __GMP_PROTO ((char *, size_t, __gmp_const char *, ...)); #define gmp_sprintf __gmp_sprintf __GMP_DECLSPEC int gmp_sprintf __GMP_PROTO ((char *, __gmp_const char *, ...)); #define gmp_vasprintf __gmp_vasprintf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vasprintf __GMP_PROTO ((char **, __gmp_const char *, va_list)); #endif #define gmp_vfprintf __gmp_vfprintf #if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vfprintf __GMP_PROTO ((FILE *, __gmp_const char *, va_list)); #endif #define gmp_vprintf __gmp_vprintf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vprintf __GMP_PROTO ((__gmp_const char *, va_list)); #endif #define gmp_vsnprintf __gmp_vsnprintf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vsnprintf __GMP_PROTO ((char *, size_t, __gmp_const char *, va_list)); #endif #define gmp_vsprintf __gmp_vsprintf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vsprintf __GMP_PROTO ((char *, __gmp_const char *, va_list)); #endif /**************** Formatted input routines. ****************/ #define gmp_fscanf __gmp_fscanf #ifdef _GMP_H_HAVE_FILE __GMP_DECLSPEC int gmp_fscanf __GMP_PROTO ((FILE *, __gmp_const char *, ...)); #endif #define gmp_scanf __gmp_scanf __GMP_DECLSPEC int gmp_scanf __GMP_PROTO ((__gmp_const char *, ...)); #define gmp_sscanf __gmp_sscanf __GMP_DECLSPEC int gmp_sscanf __GMP_PROTO ((__gmp_const char *, __gmp_const char *, ...)); #define gmp_vfscanf __gmp_vfscanf #if defined (_GMP_H_HAVE_FILE) && defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vfscanf __GMP_PROTO ((FILE *, __gmp_const char *, va_list)); #endif #define gmp_vscanf __gmp_vscanf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vscanf __GMP_PROTO ((__gmp_const char *, va_list)); #endif #define gmp_vsscanf __gmp_vsscanf #if defined (_GMP_H_HAVE_VA_LIST) __GMP_DECLSPEC int gmp_vsscanf __GMP_PROTO ((__gmp_const char *, __gmp_const char *, va_list)); #endif /**************** Integer (i.e. Z) routines. ****************/ #define _mpz_realloc __gmpz_realloc #define mpz_realloc __gmpz_realloc __GMP_DECLSPEC void *_mpz_realloc __GMP