bfin.h 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /* Blackfin ELF support for BFD.
  2. Copyright (C) 2005-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_BFIN_H
  16. #define _ELF_BFIN_H
  17. #include "elf/reloc-macros.h"
  18. START_RELOC_NUMBERS (elf_bfin_reloc_type)
  19. RELOC_NUMBER (R_BFIN_UNUSED0, 0x00) /* relocation type 0 is not defined */
  20. RELOC_NUMBER (R_BFIN_PCREL5M2, 0x01) /* LSETUP part a */
  21. RELOC_NUMBER (R_BFIN_UNUSED1, 0x02) /* relocation type 2 is not defined */
  22. RELOC_NUMBER (R_BFIN_PCREL10, 0x03) /* type 3, 0x00) if cc jump <target> */
  23. RELOC_NUMBER (R_BFIN_PCREL12_JUMP, 0x04) /* type 4, 0x00) jump <target> */
  24. RELOC_NUMBER (R_BFIN_RIMM16, 0x05) /* type 0x5, 0x00) rN = <target> */
  25. RELOC_NUMBER (R_BFIN_LUIMM16, 0x06) /* # 0x6, 0x00) preg.l=<target> Load imm 16 to lower half */
  26. RELOC_NUMBER (R_BFIN_HUIMM16, 0x07) /* # 0x7, 0x00) preg.h=<target> Load imm 16 to upper half */
  27. RELOC_NUMBER (R_BFIN_PCREL12_JUMP_S, 0x08) /* # 0x8 jump.s <target> */
  28. RELOC_NUMBER (R_BFIN_PCREL24_JUMP_X, 0x09) /* # 0x9 jump.x <target> */
  29. RELOC_NUMBER (R_BFIN_PCREL24, 0x0a) /* # 0xa call <target> , 0x00) not expandable */
  30. RELOC_NUMBER (R_BFIN_UNUSEDB, 0x0b) /* # 0xb not generated */
  31. RELOC_NUMBER (R_BFIN_UNUSEDC, 0x0c) /* # 0xc not used */
  32. RELOC_NUMBER (R_BFIN_PCREL24_JUMP_L, 0x0d) /* 0xd jump.l <target> */
  33. RELOC_NUMBER (R_BFIN_PCREL24_CALL_X, 0x0e) /* 0xE, 0x00) call.x <target> if <target> is above 24 bit limit call through P1 */
  34. RELOC_NUMBER (R_BFIN_VAR_EQ_SYMB, 0x0f) /* 0xf, 0x00) linker should treat it same as 0x12 */
  35. RELOC_NUMBER (R_BFIN_BYTE_DATA, 0x10) /* 0x10, 0x00) .byte var = symbol */
  36. RELOC_NUMBER (R_BFIN_BYTE2_DATA, 0x11) /* 0x11, 0x00) .byte2 var = symbol */
  37. RELOC_NUMBER (R_BFIN_BYTE4_DATA, 0x12) /* 0x12, 0x00) .byte4 var = symbol and .var var=symbol */
  38. RELOC_NUMBER (R_BFIN_PCREL11, 0x13) /* 0x13, 0x00) lsetup part b */
  39. RELOC_NUMBER (R_BFIN_GOT17M4, 0x14)
  40. RELOC_NUMBER (R_BFIN_GOTHI, 0x15)
  41. RELOC_NUMBER (R_BFIN_GOTLO, 0x16)
  42. RELOC_NUMBER (R_BFIN_FUNCDESC, 0x17)
  43. RELOC_NUMBER (R_BFIN_FUNCDESC_GOT17M4, 0x18)
  44. RELOC_NUMBER (R_BFIN_FUNCDESC_GOTHI, 0x19)
  45. RELOC_NUMBER (R_BFIN_FUNCDESC_GOTLO, 0x1a)
  46. RELOC_NUMBER (R_BFIN_FUNCDESC_VALUE, 0x1b)
  47. RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFF17M4, 0x1c)
  48. RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFHI, 0x1d)
  49. RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFLO, 0x1e)
  50. RELOC_NUMBER (R_BFIN_GOTOFF17M4, 0x1f)
  51. RELOC_NUMBER (R_BFIN_GOTOFFHI, 0x20)
  52. RELOC_NUMBER (R_BFIN_GOTOFFLO, 0x21)
  53. RELOC_NUMBER (R_BFIN_PUSH, 0xE0)
  54. RELOC_NUMBER (R_BFIN_CONST, 0xE1)
  55. RELOC_NUMBER (R_BFIN_ADD, 0xE2)
  56. RELOC_NUMBER (R_BFIN_SUB, 0xE3)
  57. RELOC_NUMBER (R_BFIN_MULT, 0xE4)
  58. RELOC_NUMBER (R_BFIN_DIV, 0xE5)
  59. RELOC_NUMBER (R_BFIN_MOD, 0xE6)
  60. RELOC_NUMBER (R_BFIN_LSHIFT, 0xE7)
  61. RELOC_NUMBER (R_BFIN_RSHIFT, 0xE8)
  62. RELOC_NUMBER (R_BFIN_AND, 0xE9)
  63. RELOC_NUMBER (R_BFIN_OR, 0xEA)
  64. RELOC_NUMBER (R_BFIN_XOR, 0xEB)
  65. RELOC_NUMBER (R_BFIN_LAND, 0xEC)
  66. RELOC_NUMBER (R_BFIN_LOR, 0xED)
  67. RELOC_NUMBER (R_BFIN_LEN, 0xEE)
  68. RELOC_NUMBER (R_BFIN_NEG, 0xEF)
  69. RELOC_NUMBER (R_BFIN_COMP, 0xF0)
  70. RELOC_NUMBER (R_BFIN_PAGE, 0xF1)
  71. RELOC_NUMBER (R_BFIN_HWPAGE, 0xF2)
  72. RELOC_NUMBER (R_BFIN_ADDR, 0xF3)
  73. RELOC_NUMBER (R_BFIN_PLTPC, 0x40) /* PLT gnu only relocation */
  74. RELOC_NUMBER (R_BFIN_GOT, 0x41) /* GOT gnu only relocation */
  75. RELOC_NUMBER (R_BFIN_GNU_VTINHERIT, 0x42) /* C++, gnu only */
  76. RELOC_NUMBER (R_BFIN_GNU_VTENTRY, 0x43) /* C++, gnu only */
  77. END_RELOC_NUMBERS (R_BFIN_max)
  78. /* Processor specific flags for the ELF header e_flags field. */
  79. #define EF_BFIN_PIC 0x00000001 /* -fpic */
  80. #define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */
  81. #define EF_BFIN_CODE_IN_L1 0x00000010 /* --code-in-l1 */
  82. #define EF_BFIN_DATA_IN_L1 0x00000020 /* --data-in-l1 */
  83. #define EF_BFIN_PIC_FLAGS (EF_BFIN_PIC | EF_BFIN_FDPIC)
  84. #endif /* _ELF_BFIN_H */