1 |
/* MIPS ELF support for BFD. |
/* MIPS ELF support for BFD. |
2 |
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, |
3 |
|
2003, 2004, 2005 |
4 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
5 |
|
|
6 |
By Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>, from |
By Ian Lance Taylor, Cygnus Support, <ian@cygnus.com>, from |
73 |
RELOC_NUMBER (R_MIPS_PJUMP, 35) |
RELOC_NUMBER (R_MIPS_PJUMP, 35) |
74 |
RELOC_NUMBER (R_MIPS_RELGOT, 36) |
RELOC_NUMBER (R_MIPS_RELGOT, 36) |
75 |
RELOC_NUMBER (R_MIPS_JALR, 37) |
RELOC_NUMBER (R_MIPS_JALR, 37) |
76 |
RELOC_NUMBER (R_MIPS_max, 38) |
/* TLS relocations. */ |
77 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPMOD32, 38) |
78 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPREL32, 39) |
79 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPMOD64, 40) |
80 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPREL64, 41) |
81 |
|
RELOC_NUMBER (R_MIPS_TLS_GD, 42) |
82 |
|
RELOC_NUMBER (R_MIPS_TLS_LDM, 43) |
83 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPREL_HI16, 44) |
84 |
|
RELOC_NUMBER (R_MIPS_TLS_DTPREL_LO16, 45) |
85 |
|
RELOC_NUMBER (R_MIPS_TLS_GOTTPREL, 46) |
86 |
|
RELOC_NUMBER (R_MIPS_TLS_TPREL32, 47) |
87 |
|
RELOC_NUMBER (R_MIPS_TLS_TPREL64, 48) |
88 |
|
RELOC_NUMBER (R_MIPS_TLS_TPREL_HI16, 49) |
89 |
|
RELOC_NUMBER (R_MIPS_TLS_TPREL_LO16, 50) |
90 |
|
FAKE_RELOC (R_MIPS_max, 51) |
91 |
/* These relocs are used for the mips16. */ |
/* These relocs are used for the mips16. */ |
92 |
|
FAKE_RELOC (R_MIPS16_min, 100) |
93 |
RELOC_NUMBER (R_MIPS16_26, 100) |
RELOC_NUMBER (R_MIPS16_26, 100) |
94 |
RELOC_NUMBER (R_MIPS16_GPREL, 101) |
RELOC_NUMBER (R_MIPS16_GPREL, 101) |
95 |
/* These are GNU extensions to handle embedded-pic. */ |
RELOC_NUMBER (R_MIPS16_GOT16, 102) |
96 |
|
RELOC_NUMBER (R_MIPS16_CALL16, 103) |
97 |
|
RELOC_NUMBER (R_MIPS16_HI16, 104) |
98 |
|
RELOC_NUMBER (R_MIPS16_LO16, 105) |
99 |
|
FAKE_RELOC (R_MIPS16_max, 106) |
100 |
|
/* This was a GNU extension used by embedded-PIC. It was co-opted by |
101 |
|
mips-linux for exception-handling data. It is no longer used, but |
102 |
|
should continue to be supported by the linker for backward |
103 |
|
compatibility. (GCC stopped using it in May, 2004.) */ |
104 |
RELOC_NUMBER (R_MIPS_PC32, 248) |
RELOC_NUMBER (R_MIPS_PC32, 248) |
105 |
RELOC_NUMBER (R_MIPS_PC64, 249) |
/* FIXME: this relocation is used internally by gas. */ |
106 |
RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250) |
RELOC_NUMBER (R_MIPS_GNU_REL16_S2, 250) |
|
RELOC_NUMBER (R_MIPS_GNU_REL_LO16, 251) |
|
|
RELOC_NUMBER (R_MIPS_GNU_REL_HI16, 252) |
|
107 |
/* These are GNU extensions to enable C++ vtable garbage collection. */ |
/* These are GNU extensions to enable C++ vtable garbage collection. */ |
108 |
RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253) |
RELOC_NUMBER (R_MIPS_GNU_VTINHERIT, 253) |
109 |
RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254) |
RELOC_NUMBER (R_MIPS_GNU_VTENTRY, 254) |
121 |
position independent code. */ |
position independent code. */ |
122 |
#define EF_MIPS_CPIC 0x00000004 |
#define EF_MIPS_CPIC 0x00000004 |
123 |
|
|
124 |
|
/* ??? Unknown flag, set in IRIX 6's BSDdup2.o in libbsd.a. */ |
125 |
|
#define EF_MIPS_XGOT 0x00000008 |
126 |
|
|
127 |
/* Code in file uses UCODE (obsolete) */ |
/* Code in file uses UCODE (obsolete) */ |
128 |
#define EF_MIPS_UCODE 0x00000010 |
#define EF_MIPS_UCODE 0x00000010 |
129 |
|
|
170 |
/* -mips64 code. */ |
/* -mips64 code. */ |
171 |
#define E_MIPS_ARCH_64 0x60000000 |
#define E_MIPS_ARCH_64 0x60000000 |
172 |
|
|
173 |
|
/* -mips32r2 code. */ |
174 |
|
#define E_MIPS_ARCH_32R2 0x70000000 |
175 |
|
|
176 |
|
/* -mips64r2 code. */ |
177 |
|
#define E_MIPS_ARCH_64R2 0x80000000 |
178 |
|
|
179 |
/* The ABI of the file. Also see EF_MIPS_ABI2 above. */ |
/* The ABI of the file. Also see EF_MIPS_ABI2 above. */ |
180 |
#define EF_MIPS_ABI 0x0000F000 |
#define EF_MIPS_ABI 0x0000F000 |
181 |
|
|
206 |
#define E_MIPS_MACH_4010 0x00820000 |
#define E_MIPS_MACH_4010 0x00820000 |
207 |
#define E_MIPS_MACH_4100 0x00830000 |
#define E_MIPS_MACH_4100 0x00830000 |
208 |
#define E_MIPS_MACH_4650 0x00850000 |
#define E_MIPS_MACH_4650 0x00850000 |
209 |
|
#define E_MIPS_MACH_4120 0x00870000 |
210 |
#define E_MIPS_MACH_4111 0x00880000 |
#define E_MIPS_MACH_4111 0x00880000 |
211 |
#define E_MIPS_MACH_SB1 0x008a0000 |
#define E_MIPS_MACH_SB1 0x008a0000 |
212 |
|
#define E_MIPS_MACH_5400 0x00910000 |
213 |
|
#define E_MIPS_MACH_5500 0x00980000 |
214 |
|
#define E_MIPS_MACH_9000 0x00990000 |
215 |
|
|
216 |
/* Processor specific section indices. These sections do not actually |
/* Processor specific section indices. These sections do not actually |
217 |
exist. Symbols with a st_shndx field corresponding to one of these |
exist. Symbols with a st_shndx field corresponding to one of these |
482 |
|
|
483 |
/* MIPS ELF .reginfo swapping routines. */ |
/* MIPS ELF .reginfo swapping routines. */ |
484 |
extern void bfd_mips_elf32_swap_reginfo_in |
extern void bfd_mips_elf32_swap_reginfo_in |
485 |
PARAMS ((bfd *, const Elf32_External_RegInfo *, Elf32_RegInfo *)); |
(bfd *, const Elf32_External_RegInfo *, Elf32_RegInfo *); |
486 |
extern void bfd_mips_elf32_swap_reginfo_out |
extern void bfd_mips_elf32_swap_reginfo_out |
487 |
PARAMS ((bfd *, const Elf32_RegInfo *, Elf32_External_RegInfo *)); |
(bfd *, const Elf32_RegInfo *, Elf32_External_RegInfo *); |
488 |
|
|
489 |
/* Processor specific section flags. */ |
/* Processor specific section flags. */ |
490 |
|
|
848 |
|
|
849 |
/* MIPS ELF option header swapping routines. */ |
/* MIPS ELF option header swapping routines. */ |
850 |
extern void bfd_mips_elf_swap_options_in |
extern void bfd_mips_elf_swap_options_in |
851 |
PARAMS ((bfd *, const Elf_External_Options *, Elf_Internal_Options *)); |
(bfd *, const Elf_External_Options *, Elf_Internal_Options *); |
852 |
extern void bfd_mips_elf_swap_options_out |
extern void bfd_mips_elf_swap_options_out |
853 |
PARAMS ((bfd *, const Elf_Internal_Options *, Elf_External_Options *)); |
(bfd *, const Elf_Internal_Options *, Elf_External_Options *); |
854 |
|
|
855 |
/* Values which may appear in the kind field of an Elf_Options |
/* Values which may appear in the kind field of an Elf_Options |
856 |
structure. */ |
structure. */ |
952 |
|
|
953 |
/* MIPS ELF reginfo swapping routines. */ |
/* MIPS ELF reginfo swapping routines. */ |
954 |
extern void bfd_mips_elf64_swap_reginfo_in |
extern void bfd_mips_elf64_swap_reginfo_in |
955 |
PARAMS ((bfd *, const Elf64_External_RegInfo *, Elf64_Internal_RegInfo *)); |
(bfd *, const Elf64_External_RegInfo *, Elf64_Internal_RegInfo *); |
956 |
extern void bfd_mips_elf64_swap_reginfo_out |
extern void bfd_mips_elf64_swap_reginfo_out |
957 |
PARAMS ((bfd *, const Elf64_Internal_RegInfo *, Elf64_External_RegInfo *)); |
(bfd *, const Elf64_Internal_RegInfo *, Elf64_External_RegInfo *); |
958 |
|
|
959 |
/* Masks for the info work of an ODK_EXCEPTIONS descriptor. */ |
/* Masks for the info work of an ODK_EXCEPTIONS descriptor. */ |
960 |
#define OEX_FPU_MIN 0x1f /* FPEs which must be enabled. */ |
#define OEX_FPU_MIN 0x1f /* FPEs which must be enabled. */ |