blob: 63c6cdd6cf4a4e87ec7cfdad184dce0421878065 [file] [log] [blame]
Alan Modraf37164d2019-09-23 10:06:45 +09301/* 32-bit ELF support for ARM
Alan Modraa2c58332022-01-02 09:00:17 +10302 Copyright (C) 2019-2022 Free Software Foundation, Inc.
Alan Modraf37164d2019-09-23 10:06:45 +09303
4 This file is part of BFD, the Binary File Descriptor library.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
21
22/* ARM VFP11 erratum workaround support. */
23typedef enum
24{
25 BFD_ARM_VFP11_FIX_DEFAULT,
26 BFD_ARM_VFP11_FIX_NONE,
27 BFD_ARM_VFP11_FIX_SCALAR,
28 BFD_ARM_VFP11_FIX_VECTOR
29} bfd_arm_vfp11_fix;
30
31extern void bfd_elf32_arm_init_maps
32 (bfd *);
33
34extern void bfd_elf32_arm_set_vfp11_fix
35 (bfd *, struct bfd_link_info *);
36
37extern void bfd_elf32_arm_set_cortex_a8_fix
38 (bfd *, struct bfd_link_info *);
39
Alan Modra0a1b45a2021-03-31 10:30:54 +103040extern bool bfd_elf32_arm_vfp11_erratum_scan
Alan Modraf37164d2019-09-23 10:06:45 +093041 (bfd *, struct bfd_link_info *);
42
43extern void bfd_elf32_arm_vfp11_fix_veneer_locations
44 (bfd *, struct bfd_link_info *);
45
46/* ARM STM STM32L4XX erratum workaround support. */
47typedef enum
48{
49 BFD_ARM_STM32L4XX_FIX_NONE,
50 BFD_ARM_STM32L4XX_FIX_DEFAULT,
51 BFD_ARM_STM32L4XX_FIX_ALL
52} bfd_arm_stm32l4xx_fix;
53
54extern void bfd_elf32_arm_set_stm32l4xx_fix
55 (bfd *, struct bfd_link_info *);
56
Alan Modra0a1b45a2021-03-31 10:30:54 +103057extern bool bfd_elf32_arm_stm32l4xx_erratum_scan
Alan Modraf37164d2019-09-23 10:06:45 +093058 (bfd *, struct bfd_link_info *);
59
60extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
61 (bfd *, struct bfd_link_info *);
62
63/* ELF ARM Interworking support. Called from linker. */
Alan Modra0a1b45a2021-03-31 10:30:54 +103064extern bool bfd_elf32_arm_allocate_interworking_sections
Alan Modraf37164d2019-09-23 10:06:45 +093065 (struct bfd_link_info *);
66
Alan Modra0a1b45a2021-03-31 10:30:54 +103067extern bool bfd_elf32_arm_process_before_allocation
Alan Modraf37164d2019-09-23 10:06:45 +093068 (bfd *, struct bfd_link_info *);
69
70struct elf32_arm_params {
71 char *thumb_entry_symbol;
72 int byteswap_code;
73 int target1_is_rel;
74 char * target2_type;
75 int fix_v4bx;
76 int use_blx;
77 bfd_arm_vfp11_fix vfp11_denorm_fix;
78 bfd_arm_stm32l4xx_fix stm32l4xx_fix;
79 int no_enum_size_warning;
80 int no_wchar_size_warning;
81 int pic_veneer;
82 int fix_cortex_a8;
83 int fix_arm1176;
84 int merge_exidx_entries;
85 int cmse_implib;
86 bfd *in_implib_bfd;
87};
88
89void bfd_elf32_arm_set_target_params
90 (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
91
Alan Modra0a1b45a2021-03-31 10:30:54 +103092extern bool bfd_elf32_arm_get_bfd_for_interworking
Alan Modraf37164d2019-09-23 10:06:45 +093093 (bfd *, struct bfd_link_info *);
94
Alan Modra0a1b45a2021-03-31 10:30:54 +103095extern bool bfd_elf32_arm_add_glue_sections_to_bfd
Alan Modraf37164d2019-09-23 10:06:45 +093096 (bfd *, struct bfd_link_info *);
97
98extern void bfd_elf32_arm_keep_private_stub_output_sections
99 (struct bfd_link_info *);
100
101extern void bfd_elf32_arm_set_byteswap_code
102 (struct bfd_link_info *, int);
103
104extern void bfd_elf32_arm_use_long_plt (void);
105
106/* ARM stub generation support. Called from the linker. */
107extern int elf32_arm_setup_section_lists
108 (bfd *, struct bfd_link_info *);
109extern void elf32_arm_next_input_section
110 (struct bfd_link_info *, struct bfd_section *);
Alan Modra0a1b45a2021-03-31 10:30:54 +1030111extern bool elf32_arm_size_stubs
Alan Modraf37164d2019-09-23 10:06:45 +0930112 (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
113 struct bfd_section * (*) (const char *, struct bfd_section *,
114 struct bfd_section *, unsigned int),
115 void (*) (void));
Alan Modra0a1b45a2021-03-31 10:30:54 +1030116extern bool elf32_arm_build_stubs
Alan Modraf37164d2019-09-23 10:06:45 +0930117 (struct bfd_link_info *);
118
119/* ARM unwind section editing support. */
Alan Modra0a1b45a2021-03-31 10:30:54 +1030120extern bool elf32_arm_fix_exidx_coverage
121(struct bfd_section **, unsigned int, struct bfd_link_info *, bool);