mips.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. // mips.h -- ELF definitions specific to EM_MIPS -*- C++ -*-
  2. // Copyright (C) 2012-2022 Free Software Foundation, Inc.
  3. // Written by Sasa Stankovic <sasa.stankovic@imgtec.com>
  4. // and Aleksandar Simeonov <aleksandar.simeonov@rt-rk.com>.
  5. // This file is part of elfcpp.
  6. // This program is free software; you can redistribute it and/or
  7. // modify it under the terms of the GNU Library General Public License
  8. // as published by the Free Software Foundation; either version 2, or
  9. // (at your option) any later version.
  10. // In addition to the permissions in the GNU Library General Public
  11. // License, the Free Software Foundation gives you unlimited
  12. // permission to link the compiled version of this file into
  13. // combinations with other programs, and to distribute those
  14. // combinations without any restriction coming from the use of this
  15. // file. (The Library Public License restrictions do apply in other
  16. // respects; for example, they cover modification of the file, and
  17. /// distribution when not linked into a combined executable.)
  18. // This program is distributed in the hope that it will be useful, but
  19. // WITHOUT ANY WARRANTY; without even the implied warranty of
  20. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. // Library General Public License for more details.
  22. // You should have received a copy of the GNU Library General Public
  23. // License along with this program; if not, write to the Free Software
  24. // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  25. // 02110-1301, USA.
  26. #ifndef ELFCPP_MIPS_H
  27. #define ELFCPP_MIPS_H
  28. // Documentation for the MIPS relocs is taken from
  29. // http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf
  30. namespace elfcpp
  31. {
  32. //
  33. // MIPS Relocation Codes
  34. //
  35. enum
  36. {
  37. R_MIPS_NONE = 0,
  38. R_MIPS_16 = 1,
  39. R_MIPS_32 = 2, // In Elf 64: alias R_MIPS_ADD
  40. R_MIPS_REL32 = 3, // In Elf 64: alias R_MIPS_REL
  41. R_MIPS_26 = 4,
  42. R_MIPS_HI16 = 5,
  43. R_MIPS_LO16 = 6,
  44. R_MIPS_GPREL16 = 7, // In Elf 64: alias R_MIPS_GPREL
  45. R_MIPS_LITERAL = 8,
  46. R_MIPS_GOT16 = 9, // In Elf 64: alias R_MIPS_GOT
  47. R_MIPS_PC16 = 10,
  48. R_MIPS_CALL16 = 11, // In Elf 64: alias R_MIPS_CALL
  49. R_MIPS_GPREL32 = 12,
  50. R_MIPS_UNUSED1 = 13,
  51. R_MIPS_UNUSED2 = 14,
  52. R_MIPS_UNUSED3 = 15,
  53. R_MIPS_SHIFT5 = 16,
  54. R_MIPS_SHIFT6 = 17,
  55. R_MIPS_64 = 18,
  56. R_MIPS_GOT_DISP = 19,
  57. R_MIPS_GOT_PAGE = 20,
  58. R_MIPS_GOT_OFST = 21,
  59. R_MIPS_GOT_HI16 = 22,
  60. R_MIPS_GOT_LO16 = 23,
  61. R_MIPS_SUB = 24,
  62. R_MIPS_INSERT_A = 25,
  63. R_MIPS_INSERT_B = 26,
  64. R_MIPS_DELETE = 27,
  65. R_MIPS_HIGHER = 28,
  66. R_MIPS_HIGHEST = 29,
  67. R_MIPS_CALL_HI16 = 30,
  68. R_MIPS_CALL_LO16 = 31,
  69. R_MIPS_SCN_DISP = 32,
  70. R_MIPS_REL16 = 33,
  71. R_MIPS_ADD_IMMEDIATE = 34,
  72. R_MIPS_PJUMP = 35,
  73. R_MIPS_RELGOT = 36,
  74. R_MIPS_JALR = 37,
  75. // TLS relocations.
  76. R_MIPS_TLS_DTPMOD32 = 38,
  77. R_MIPS_TLS_DTPREL32 = 39,
  78. R_MIPS_TLS_DTPMOD64 = 40,
  79. R_MIPS_TLS_DTPREL64 = 41,
  80. R_MIPS_TLS_GD = 42,
  81. R_MIPS_TLS_LDM = 43,
  82. R_MIPS_TLS_DTPREL_HI16 = 44,
  83. R_MIPS_TLS_DTPREL_LO16 = 45,
  84. R_MIPS_TLS_GOTTPREL = 46,
  85. R_MIPS_TLS_TPREL32 = 47,
  86. R_MIPS_TLS_TPREL64 = 48,
  87. R_MIPS_TLS_TPREL_HI16 = 49,
  88. R_MIPS_TLS_TPREL_LO16 = 50,
  89. R_MIPS_GLOB_DAT = 51,
  90. R_MIPS_PC21_S2 = 60,
  91. R_MIPS_PC26_S2 = 61,
  92. R_MIPS_PC18_S3 = 62,
  93. R_MIPS_PC19_S2 = 63,
  94. R_MIPS_PCHI16 = 64,
  95. R_MIPS_PCLO16 = 65,
  96. // These relocs are used for the mips16.
  97. R_MIPS16_26 = 100,
  98. R_MIPS16_GPREL = 101,
  99. R_MIPS16_GOT16 = 102,
  100. R_MIPS16_CALL16 = 103,
  101. R_MIPS16_HI16 = 104,
  102. R_MIPS16_LO16 = 105,
  103. R_MIPS16_TLS_GD = 106,
  104. R_MIPS16_TLS_LDM = 107,
  105. R_MIPS16_TLS_DTPREL_HI16 = 108,
  106. R_MIPS16_TLS_DTPREL_LO16 = 109,
  107. R_MIPS16_TLS_GOTTPREL = 110,
  108. R_MIPS16_TLS_TPREL_HI16 = 111,
  109. R_MIPS16_TLS_TPREL_LO16 = 112,
  110. R_MIPS_COPY = 126,
  111. R_MIPS_JUMP_SLOT = 127,
  112. // These relocations are specific to microMIPS.
  113. R_MICROMIPS_26_S1 = 133,
  114. R_MICROMIPS_HI16 = 134,
  115. R_MICROMIPS_LO16 = 135,
  116. R_MICROMIPS_GPREL16 = 136, // In Elf 64: alias R_MICROMIPS_GPREL
  117. R_MICROMIPS_LITERAL = 137,
  118. R_MICROMIPS_GOT16 = 138, // In Elf 64: alias R_MICROMIPS_GOT
  119. R_MICROMIPS_PC7_S1 = 139,
  120. R_MICROMIPS_PC10_S1 = 140,
  121. R_MICROMIPS_PC16_S1 = 141,
  122. R_MICROMIPS_CALL16 = 142, // In Elf 64: alias R_MICROMIPS_CALL
  123. R_MICROMIPS_GOT_DISP = 145,
  124. R_MICROMIPS_GOT_PAGE = 146,
  125. R_MICROMIPS_GOT_OFST = 147,
  126. R_MICROMIPS_GOT_HI16 = 148,
  127. R_MICROMIPS_GOT_LO16 = 149,
  128. R_MICROMIPS_SUB = 150,
  129. R_MICROMIPS_HIGHER = 151,
  130. R_MICROMIPS_HIGHEST = 152,
  131. R_MICROMIPS_CALL_HI16 = 153,
  132. R_MICROMIPS_CALL_LO16 = 154,
  133. R_MICROMIPS_SCN_DISP = 155,
  134. R_MICROMIPS_JALR = 156,
  135. R_MICROMIPS_HI0_LO16 = 157,
  136. // TLS relocations.
  137. R_MICROMIPS_TLS_GD = 162,
  138. R_MICROMIPS_TLS_LDM = 163,
  139. R_MICROMIPS_TLS_DTPREL_HI16 = 164,
  140. R_MICROMIPS_TLS_DTPREL_LO16 = 165,
  141. R_MICROMIPS_TLS_GOTTPREL = 166,
  142. R_MICROMIPS_TLS_TPREL_HI16 = 169,
  143. R_MICROMIPS_TLS_TPREL_LO16 = 170,
  144. // microMIPS GP- and PC-relative relocations.
  145. R_MICROMIPS_GPREL7_S2 = 172,
  146. R_MICROMIPS_PC23_S2 = 173,
  147. // This was a GNU extension used by embedded-PIC. It was co-opted by
  148. // mips-linux for exception-handling data. GCC stopped using it in
  149. // May, 2004, then started using it again for compact unwind tables.
  150. R_MIPS_PC32 = 248,
  151. R_MIPS_EH = 249,
  152. // This relocation is used internally by gas.
  153. R_MIPS_GNU_REL16_S2 = 250,
  154. // These are GNU extensions to enable C++ vtable garbage collection.
  155. R_MIPS_GNU_VTINHERIT = 253,
  156. R_MIPS_GNU_VTENTRY = 254
  157. };
  158. // Processor specific flags for the ELF header e_flags field.
  159. enum
  160. {
  161. // At least one .noreorder directive appears in the source.
  162. EF_MIPS_NOREORDER = 0x00000001,
  163. // File contains position independent code.
  164. EF_MIPS_PIC = 0x00000002,
  165. // Code in file uses the standard calling sequence for calling
  166. // position independent code.
  167. EF_MIPS_CPIC = 0x00000004,
  168. // ??? Unknown flag, set in IRIX 6's BSDdup2.o in libbsd.a.
  169. EF_MIPS_XGOT = 0x00000008,
  170. // Code in file uses UCODE (obsolete)
  171. EF_MIPS_UCODE = 0x00000010,
  172. // Code in file uses new ABI (-n32 on Irix 6).
  173. EF_MIPS_ABI2 = 0x00000020,
  174. // Process the .MIPS.options section first by ld
  175. EF_MIPS_OPTIONS_FIRST = 0x00000080,
  176. // Architectural Extensions used by this file
  177. EF_MIPS_ARCH_ASE = 0x0f000000,
  178. // Use MDMX multimedia extensions
  179. EF_MIPS_ARCH_ASE_MDMX = 0x08000000,
  180. // Use MIPS-16 ISA extensions
  181. EF_MIPS_ARCH_ASE_M16 = 0x04000000,
  182. // Use MICROMIPS ISA extensions.
  183. EF_MIPS_ARCH_ASE_MICROMIPS = 0x02000000,
  184. // Indicates code compiled for a 64-bit machine in 32-bit mode.
  185. // (regs are 32-bits wide.)
  186. EF_MIPS_32BITMODE = 0x00000100,
  187. // 32-bit machine but FP registers are 64 bit (-mfp64).
  188. EF_MIPS_FP64 = 0x00000200,
  189. /// Code in file uses the IEEE 754-2008 NaN encoding convention.
  190. EF_MIPS_NAN2008 = 0x00000400,
  191. // MIPS dynamic
  192. EF_MIPS_DYNAMIC = 0x40
  193. };
  194. // Machine variant if we know it. This field was invented at Cygnus,
  195. // but it is hoped that other vendors will adopt it. If some standard
  196. // is developed, this code should be changed to follow it.
  197. enum
  198. {
  199. EF_MIPS_MACH = 0x00FF0000,
  200. // Cygnus is choosing values between 80 and 9F;
  201. // 00 - 7F should be left for a future standard;
  202. // the rest are open.
  203. E_MIPS_MACH_3900 = 0x00810000,
  204. E_MIPS_MACH_4010 = 0x00820000,
  205. E_MIPS_MACH_4100 = 0x00830000,
  206. E_MIPS_MACH_4650 = 0x00850000,
  207. E_MIPS_MACH_4120 = 0x00870000,
  208. E_MIPS_MACH_4111 = 0x00880000,
  209. E_MIPS_MACH_SB1 = 0x008a0000,
  210. E_MIPS_MACH_OCTEON = 0x008b0000,
  211. E_MIPS_MACH_XLR = 0x008c0000,
  212. E_MIPS_MACH_OCTEON2 = 0x008d0000,
  213. E_MIPS_MACH_OCTEON3 = 0x008e0000,
  214. E_MIPS_MACH_5400 = 0x00910000,
  215. E_MIPS_MACH_5900 = 0x00920000,
  216. E_MIPS_MACH_5500 = 0x00980000,
  217. E_MIPS_MACH_9000 = 0x00990000,
  218. E_MIPS_MACH_LS2E = 0x00A00000,
  219. E_MIPS_MACH_LS2F = 0x00A10000,
  220. E_MIPS_MACH_GS464 = 0x00A20000,
  221. E_MIPS_MACH_GS464E = 0x00A30000,
  222. E_MIPS_MACH_GS264E = 0x00A40000,
  223. };
  224. // MIPS architecture
  225. enum
  226. {
  227. // Four bit MIPS architecture field.
  228. EF_MIPS_ARCH = 0xf0000000,
  229. // -mips1 code.
  230. E_MIPS_ARCH_1 = 0x00000000,
  231. // -mips2 code.
  232. E_MIPS_ARCH_2 = 0x10000000,
  233. // -mips3 code.
  234. E_MIPS_ARCH_3 = 0x20000000,
  235. // -mips4 code.
  236. E_MIPS_ARCH_4 = 0x30000000,
  237. // -mips5 code.
  238. E_MIPS_ARCH_5 = 0x40000000,
  239. // -mips32 code.
  240. E_MIPS_ARCH_32 = 0x50000000,
  241. // -mips64 code.
  242. E_MIPS_ARCH_64 = 0x60000000,
  243. // -mips32r2 code.
  244. E_MIPS_ARCH_32R2 = 0x70000000,
  245. // -mips64r2 code.
  246. E_MIPS_ARCH_64R2 = 0x80000000,
  247. // -mips32r6 code.
  248. E_MIPS_ARCH_32R6 = 0x90000000,
  249. // -mips64r6 code.
  250. E_MIPS_ARCH_64R6 = 0xa0000000,
  251. };
  252. // Values for the xxx_size bytes of an ABI flags structure.
  253. enum
  254. {
  255. // No registers.
  256. AFL_REG_NONE = 0x00,
  257. // 32-bit registers.
  258. AFL_REG_32 = 0x01,
  259. // 64-bit registers.
  260. AFL_REG_64 = 0x02,
  261. // 128-bit registers.
  262. AFL_REG_128 = 0x03
  263. };
  264. // Masks for the ases word of an ABI flags structure.
  265. enum
  266. {
  267. // DSP ASE.
  268. AFL_ASE_DSP = 0x00000001,
  269. // DSP R2 ASE.
  270. AFL_ASE_DSPR2 = 0x00000002,
  271. // Enhanced VA Scheme.
  272. AFL_ASE_EVA = 0x00000004,
  273. // MCU (MicroController) ASE.
  274. AFL_ASE_MCU = 0x00000008,
  275. // MDMX ASE.
  276. AFL_ASE_MDMX = 0x00000010,
  277. // MIPS-3D ASE.
  278. AFL_ASE_MIPS3D = 0x00000020,
  279. // MT ASE.
  280. AFL_ASE_MT = 0x00000040,
  281. // SmartMIPS ASE.
  282. AFL_ASE_SMARTMIPS = 0x00000080,
  283. // VZ ASE.
  284. AFL_ASE_VIRT = 0x00000100,
  285. // MSA ASE.
  286. AFL_ASE_MSA = 0x00000200,
  287. // MIPS16 ASE.
  288. AFL_ASE_MIPS16 = 0x00000400,
  289. // MICROMIPS ASE.
  290. AFL_ASE_MICROMIPS = 0x00000800,
  291. // XPA ASE.
  292. AFL_ASE_XPA = 0x00001000,
  293. // Loongson EXT ASE.
  294. AFL_ASE_LOONGSON_EXT = 0x00002000
  295. };
  296. // Values for the isa_ext word of an ABI flags structure.
  297. enum
  298. {
  299. // RMI Xlr instruction.
  300. AFL_EXT_XLR = 1,
  301. // Cavium Networks Octeon2.
  302. AFL_EXT_OCTEON2 = 2,
  303. // Cavium Networks OcteonP.
  304. AFL_EXT_OCTEONP = 3,
  305. // Loongson 3A.
  306. AFL_EXT_LOONGSON_3A = 4,
  307. // Cavium Networks Octeon.
  308. AFL_EXT_OCTEON = 5,
  309. // MIPS R5900 instruction.
  310. AFL_EXT_5900 = 6,
  311. // MIPS R4650 instruction.
  312. AFL_EXT_4650 = 7,
  313. // LSI R4010 instruction.
  314. AFL_EXT_4010 = 8,
  315. // NEC VR4100 instruction.
  316. AFL_EXT_4100 = 9,
  317. // Toshiba R3900 instruction.
  318. AFL_EXT_3900 = 10,
  319. // MIPS R10000 instruction.
  320. AFL_EXT_10000 = 11,
  321. // Broadcom SB-1 instruction.
  322. AFL_EXT_SB1 = 12,
  323. // NEC VR4111/VR4181 instruction.
  324. AFL_EXT_4111 = 13,
  325. // NEC VR4120 instruction.
  326. AFL_EXT_4120 = 14,
  327. // NEC VR5400 instruction.
  328. AFL_EXT_5400 = 15,
  329. // NEC VR5500 instruction.
  330. AFL_EXT_5500 = 16,
  331. // ST Microelectronics Loongson 2E.
  332. AFL_EXT_LOONGSON_2E = 17,
  333. // ST Microelectronics Loongson 2F.
  334. AFL_EXT_LOONGSON_2F = 18,
  335. // Cavium Networks Octeon3.
  336. AFL_EXT_OCTEON3 = 19
  337. };
  338. // Masks for the flags1 word of an ABI flags structure.
  339. enum
  340. {
  341. // Uses odd single-precision registers.
  342. AFL_FLAGS1_ODDSPREG = 1
  343. };
  344. // Object attribute tags.
  345. enum
  346. {
  347. // 0-3 are generic.
  348. // Floating-point ABI used by this object file.
  349. Tag_GNU_MIPS_ABI_FP = 4,
  350. // MSA ABI used by this object file.
  351. Tag_GNU_MIPS_ABI_MSA = 8
  352. };
  353. // Object attribute values.
  354. enum
  355. {
  356. // Values defined for Tag_GNU_MIPS_ABI_FP.
  357. // Not tagged or not using any ABIs affected by the differences.
  358. Val_GNU_MIPS_ABI_FP_ANY = 0,
  359. // Using hard-float -mdouble-float.
  360. Val_GNU_MIPS_ABI_FP_DOUBLE = 1,
  361. // Using hard-float -msingle-float.
  362. Val_GNU_MIPS_ABI_FP_SINGLE = 2,
  363. // Using soft-float.
  364. Val_GNU_MIPS_ABI_FP_SOFT = 3,
  365. // Using -mips32r2 -mfp64.
  366. Val_GNU_MIPS_ABI_FP_OLD_64 = 4,
  367. // Using -mfpxx
  368. Val_GNU_MIPS_ABI_FP_XX = 5,
  369. // Using -mips32r2 -mfp64.
  370. Val_GNU_MIPS_ABI_FP_64 = 6,
  371. // Using -mips32r2 -mfp64 -mno-odd-spreg.
  372. Val_GNU_MIPS_ABI_FP_64A = 7,
  373. // This is reserved for backward-compatibility with an earlier
  374. // implementation of the MIPS NaN2008 functionality.
  375. Val_GNU_MIPS_ABI_FP_NAN2008 = 8,
  376. // Values defined for Tag_GNU_MIPS_ABI_MSA.
  377. // Not tagged or not using any ABIs affected by the differences.
  378. Val_GNU_MIPS_ABI_MSA_ANY = 0,
  379. // Using 128-bit MSA.
  380. Val_GNU_MIPS_ABI_MSA_128 = 1
  381. };
  382. enum
  383. {
  384. // Mask to extract ABI version, not really a flag value.
  385. EF_MIPS_ABI = 0x0000F000,
  386. // The original o32 abi.
  387. E_MIPS_ABI_O32 = 0x00001000,
  388. // O32 extended to work on 64 bit architectures
  389. E_MIPS_ABI_O64 = 0x00002000,
  390. // EABI in 32 bit mode
  391. E_MIPS_ABI_EABI32 = 0x00003000,
  392. // EABI in 64 bit mode
  393. E_MIPS_ABI_EABI64 = 0x00004000,
  394. };
  395. // Dynamic section MIPS flags
  396. enum
  397. {
  398. // None
  399. RHF_NONE = 0x00000000,
  400. // Use shortcut pointers
  401. RHF_QUICKSTART = 0x00000001,
  402. // Hash size not power of two
  403. RHF_NOTPOT = 0x00000002,
  404. // Ignore LD_LIBRARY_PATH
  405. RHF_NO_LIBRARY_REPLACEMENT = 0x00000004
  406. };
  407. // Special values for the st_other field in the symbol table.
  408. enum
  409. {
  410. // Two topmost bits denote the MIPS ISA for .text symbols:
  411. // + 00 -- standard MIPS code,
  412. // + 10 -- microMIPS code,
  413. // + 11 -- MIPS16 code; requires the following two bits to be set too.
  414. // Note that one of the MIPS16 bits overlaps with STO_MIPS_PIC.
  415. STO_MIPS_ISA = 0xc0,
  416. // The mask spanning the rest of MIPS psABI flags. At most one is expected
  417. // to be set except for STO_MIPS16.
  418. STO_MIPS_FLAGS = ~(STO_MIPS_ISA | 0x3),
  419. // The MIPS psABI was updated in 2008 with support for PLTs and copy
  420. // relocs. There are therefore two types of nonzero SHN_UNDEF functions:
  421. // PLT entries and traditional MIPS lazy binding stubs. We mark the former
  422. // with STO_MIPS_PLT to distinguish them from the latter.
  423. STO_MIPS_PLT = 0x8,
  424. // This value is used to mark PIC functions in an object that mixes
  425. // PIC and non-PIC. Note that this bit overlaps with STO_MIPS16,
  426. // although MIPS16 symbols are never considered to be MIPS_PIC.
  427. STO_MIPS_PIC = 0x20,
  428. // This value is used for a mips16 .text symbol.
  429. STO_MIPS16 = 0xf0,
  430. // This value is used for a microMIPS .text symbol. To distinguish from
  431. // STO_MIPS16, we set top two bits to be 10 to denote STO_MICROMIPS. The
  432. // mask is STO_MIPS_ISA.
  433. STO_MICROMIPS = 0x80
  434. };
  435. // Values for base offsets for thread-local storage
  436. enum
  437. {
  438. TP_OFFSET = 0x7000,
  439. DTP_OFFSET = 0x8000
  440. };
  441. bool
  442. elf_st_is_mips16(unsigned char st_other)
  443. { return (st_other & elfcpp::STO_MIPS16) == elfcpp::STO_MIPS16; }
  444. bool
  445. elf_st_is_micromips(unsigned char st_other)
  446. { return (st_other & elfcpp::STO_MIPS_ISA) == elfcpp::STO_MICROMIPS; }
  447. // Whether the ABI is N32.
  448. bool
  449. abi_n32(elfcpp::Elf_Word e_flags)
  450. { return (e_flags & elfcpp::EF_MIPS_ABI2) != 0; }
  451. // Whether the ISA is R6.
  452. bool
  453. r6_isa(elfcpp::Elf_Word e_flags)
  454. {
  455. return ((e_flags & elfcpp::EF_MIPS_ARCH) == elfcpp::E_MIPS_ARCH_32R6)
  456. || ((e_flags & elfcpp::EF_MIPS_ARCH) == elfcpp::E_MIPS_ARCH_64R6);
  457. }
  458. // Whether the file has microMIPS code.
  459. bool
  460. is_micromips(elfcpp::Elf_Word e_flags)
  461. { return (e_flags & elfcpp::EF_MIPS_ARCH_ASE_MICROMIPS) != 0; }
  462. // Values which may appear in the kind field of an Elf_Options structure.
  463. enum
  464. {
  465. // Undefined.
  466. ODK_NULL = 0,
  467. // Register usage and GP value.
  468. ODK_REGINFO = 1,
  469. // Exception processing information.
  470. ODK_EXCEPTIONS = 2,
  471. // Section padding information.
  472. ODK_PAD = 3,
  473. // Hardware workarounds performed.
  474. ODK_HWPATCH = 4,
  475. // Fill value used by the linker.
  476. ODK_FILL = 5,
  477. // Reserved space for desktop tools.
  478. ODK_TAGS = 6,
  479. // Hardware workarounds, AND bits when merging.
  480. ODK_HWAND = 7,
  481. // Hardware workarounds, OR bits when merging.
  482. ODK_HWOR = 8,
  483. // GP group to use for text/data sections.
  484. ODK_GP_GROUP = 9,
  485. // ID information.
  486. ODK_IDENT = 10
  487. };
  488. } // End namespace elfcpp.
  489. #endif // !defined(ELFCPP_MIPS_H)