mep.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* Toshiba MeP ELF support for BFD.
  2. Copyright (C) 2001-2022 Free Software Foundation, Inc.
  3. This file is part of BFD, the Binary File Descriptor library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
  15. #ifndef _ELF_MEP_H
  16. #define _ELF_MEP_H
  17. /* Bits in the sh_flags field of Elf32_Shdr: */
  18. #define SHF_MEP_VLIW 0x10000000 /* contains vliw code */
  19. #include "elf/reloc-macros.h"
  20. /* Note: The comments in this file are used by bfd/mep-relocs.pl to
  21. build parts of bfd/elf32-mep.c. */
  22. /* Relocations. */
  23. START_RELOC_NUMBERS (elf_mep_reloc_type)
  24. /* These two must appear first so that they are not processed by bfd/mep-relocs.pl. */
  25. RELOC_NUMBER (R_MEP_NONE, 0)
  26. RELOC_NUMBER (R_RELC, 1)
  27. RELOC_NUMBER (R_MEP_8, 2) /* 7654 3210 U */
  28. RELOC_NUMBER (R_MEP_16, 3) /* fedc ba98 7654 3210 U */
  29. RELOC_NUMBER (R_MEP_32, 4) /* vuts rqpo nmlk jihg fedc ba98 7654 3210 U */
  30. RELOC_NUMBER (R_MEP_PCREL8A2, 5) /* ---- ---- 7654 321- S PC-REL */
  31. RELOC_NUMBER (R_MEP_PCREL12A2, 6) /* ---- ba98 7654 321- S PC-REL */
  32. RELOC_NUMBER (R_MEP_PCREL17A2, 7) /* ---- ---- ---- ---- gfed cba9 8765 4321 S PC-REL */
  33. RELOC_NUMBER (R_MEP_PCREL24A2, 8) /* ---- -765 4321 ---- nmlk jihg fedc ba98 S PC-REL */
  34. RELOC_NUMBER (R_MEP_PCABS24A2, 9) /* ---- -765 4321 ---- nmlk jihg fedc ba98 U */
  35. RELOC_NUMBER (R_MEP_LOW16, 10) /* ---- ---- ---- ---- fedc ba98 7654 3210 U no-overflow */
  36. RELOC_NUMBER (R_MEP_HI16U, 11) /* ---- ---- ---- ---- vuts rqpo nmlk jihg U no-overflow */
  37. RELOC_NUMBER (R_MEP_HI16S, 12) /* ---- ---- ---- ---- vuts rqpo nmlk jihg S no-overflow */
  38. RELOC_NUMBER (R_MEP_GPREL, 13) /* ---- ---- ---- ---- fedc ba98 7654 3210 S GP-REL*/
  39. RELOC_NUMBER (R_MEP_TPREL, 14) /* ---- ---- ---- ---- fedc ba98 7654 3210 S TP-REL*/
  40. RELOC_NUMBER (R_MEP_TPREL7, 15) /* ---- ---- -654 3210 U TP-REL */
  41. RELOC_NUMBER (R_MEP_TPREL7A2, 16) /* ---- ---- -654 321- U TP-REL */
  42. RELOC_NUMBER (R_MEP_TPREL7A4, 17) /* ---- ---- -654 32-- U TP-REL */
  43. RELOC_NUMBER (R_MEP_UIMM24, 18) /* ---- ---- 7654 3210 nmlk jihg fedc ba98 U */
  44. RELOC_NUMBER (R_MEP_ADDR24A4, 19) /* ---- ---- 7654 32-- nmlk jihg fedc ba98 U */
  45. RELOC_NUMBER (R_MEP_GNU_VTINHERIT, 20) /* ---- ---- ---- ---- U no-overflow */
  46. RELOC_NUMBER (R_MEP_GNU_VTENTRY, 21) /* ---- ---- ---- ---- U no-overflow */
  47. END_RELOC_NUMBERS(R_MEP_max)
  48. #define EF_MEP_CPU_MASK 0xff000000 /* specific cpu bits */
  49. #define EF_MEP_CPU_MEP 0x00000000 /* generic MEP */
  50. #define EF_MEP_CPU_C2 0x01000000 /* MEP c2 */
  51. #define EF_MEP_CPU_C3 0x02000000 /* MEP c3 */
  52. #define EF_MEP_CPU_C4 0x04000000 /* MEP c4 */
  53. /* 5..7 are reseved */
  54. #define EF_MEP_CPU_C5 0x08000000 /* MEP c5 */
  55. #define EF_MEP_CPU_H1 0x10000000 /* MEP h1 */
  56. #define EF_MEP_COP_MASK 0x00ff0000
  57. #define EF_MEP_COP_NONE 0x00000000
  58. #define EF_MEP_COP_AVC 0x00010000
  59. #define EF_MEP_COP_AVC2 0x00020000
  60. #define EF_MEP_COP_FMAX 0x00030000
  61. /* 4..5 are reserved. */
  62. #define EF_MEP_COP_IVC2 0x00060000
  63. #define EF_MEP_LIBRARY 0x00000100 /* Built as a library */
  64. #define EF_MEP_INDEX_MASK 0x000000ff /* Configuration index */
  65. #define EF_MEP_ALL_FLAGS 0xffff01ff
  66. #endif /* _ELF_MEP_H */