elf32-arm.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /* 32-bit ELF support for ARM
  2. Copyright (C) 2019-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
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. /* ARM VFP11 erratum workaround support. */
  17. typedef enum
  18. {
  19. BFD_ARM_VFP11_FIX_DEFAULT,
  20. BFD_ARM_VFP11_FIX_NONE,
  21. BFD_ARM_VFP11_FIX_SCALAR,
  22. BFD_ARM_VFP11_FIX_VECTOR
  23. } bfd_arm_vfp11_fix;
  24. extern void bfd_elf32_arm_init_maps
  25. (bfd *);
  26. extern void bfd_elf32_arm_set_vfp11_fix
  27. (bfd *, struct bfd_link_info *);
  28. extern void bfd_elf32_arm_set_cortex_a8_fix
  29. (bfd *, struct bfd_link_info *);
  30. extern bool bfd_elf32_arm_vfp11_erratum_scan
  31. (bfd *, struct bfd_link_info *);
  32. extern void bfd_elf32_arm_vfp11_fix_veneer_locations
  33. (bfd *, struct bfd_link_info *);
  34. /* ARM STM STM32L4XX erratum workaround support. */
  35. typedef enum
  36. {
  37. BFD_ARM_STM32L4XX_FIX_NONE,
  38. BFD_ARM_STM32L4XX_FIX_DEFAULT,
  39. BFD_ARM_STM32L4XX_FIX_ALL
  40. } bfd_arm_stm32l4xx_fix;
  41. extern void bfd_elf32_arm_set_stm32l4xx_fix
  42. (bfd *, struct bfd_link_info *);
  43. extern bool bfd_elf32_arm_stm32l4xx_erratum_scan
  44. (bfd *, struct bfd_link_info *);
  45. extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
  46. (bfd *, struct bfd_link_info *);
  47. /* ELF ARM Interworking support. Called from linker. */
  48. extern bool bfd_elf32_arm_allocate_interworking_sections
  49. (struct bfd_link_info *);
  50. extern bool bfd_elf32_arm_process_before_allocation
  51. (bfd *, struct bfd_link_info *);
  52. struct elf32_arm_params {
  53. char *thumb_entry_symbol;
  54. int byteswap_code;
  55. int target1_is_rel;
  56. char * target2_type;
  57. int fix_v4bx;
  58. int use_blx;
  59. bfd_arm_vfp11_fix vfp11_denorm_fix;
  60. bfd_arm_stm32l4xx_fix stm32l4xx_fix;
  61. int no_enum_size_warning;
  62. int no_wchar_size_warning;
  63. int pic_veneer;
  64. int fix_cortex_a8;
  65. int fix_arm1176;
  66. int merge_exidx_entries;
  67. int cmse_implib;
  68. bfd *in_implib_bfd;
  69. };
  70. void bfd_elf32_arm_set_target_params
  71. (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
  72. extern bool bfd_elf32_arm_get_bfd_for_interworking
  73. (bfd *, struct bfd_link_info *);
  74. extern bool bfd_elf32_arm_add_glue_sections_to_bfd
  75. (bfd *, struct bfd_link_info *);
  76. extern void bfd_elf32_arm_keep_private_stub_output_sections
  77. (struct bfd_link_info *);
  78. extern void bfd_elf32_arm_set_byteswap_code
  79. (struct bfd_link_info *, int);
  80. extern void bfd_elf32_arm_use_long_plt (void);
  81. /* ARM stub generation support. Called from the linker. */
  82. extern int elf32_arm_setup_section_lists
  83. (bfd *, struct bfd_link_info *);
  84. extern void elf32_arm_next_input_section
  85. (struct bfd_link_info *, struct bfd_section *);
  86. extern bool elf32_arm_size_stubs
  87. (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
  88. struct bfd_section * (*) (const char *, struct bfd_section *,
  89. struct bfd_section *, unsigned int),
  90. void (*) (void));
  91. extern bool elf32_arm_build_stubs
  92. (struct bfd_link_info *);
  93. /* ARM unwind section editing support. */
  94. extern bool elf32_arm_fix_exidx_coverage
  95. (struct bfd_section **, unsigned int, struct bfd_link_info *, bool);