• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionf37164d78b0d9600862b7038b896922127749b52 (tree)
Time2019-09-23 09:57:21
AuthorAlan Modra <amodra@gmai...>
CommiterAlan Modra

Log Message

arm bfd.h tidy

bfd/
* bfd-in.h: Move arm declaraions..
* cpu-arm.h: ..to here, new file..
* coff-arm.h: ..and here, new file..
* elf32-arm.h: ..and here, new file.
* cpu-arm.c: Include cpu-arm.h.
* coff-arm.c: Include cpu-arm.h and coff-arm.h.
* elf32-arm.c: Include cpu-arm.h and elf32-arm.h.
* pe-arm.c: Move function rename defines later.
* pe-arm-wince.c: Likewise and include sysdep.h and bfd.h early.
* bfd-in2.h: Regenerate.
gas/
* config/tc-arm.c: Include cpu-arm.h.
ld/
* emultempl/armelf.em: Include elf32-arm.h.
* emultempl/pe.em: Move func defines later and include coff-arm.h.

Change Summary

Incremental Difference

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,18 @@
11 2019-09-23 Alan Modra <amodra@gmail.com>
22
3+ * bfd-in.h: Move arm declaraions..
4+ * cpu-arm.h: ..to here, new file..
5+ * coff-arm.h: ..and here, new file..
6+ * elf32-arm.h: ..and here, new file.
7+ * cpu-arm.c: Include cpu-arm.h.
8+ * coff-arm.c: Include cpu-arm.h and coff-arm.h.
9+ * elf32-arm.c: Include cpu-arm.h and elf32-arm.h.
10+ * pe-arm.c: Move function rename defines later.
11+ * pe-arm-wince.c: Likewise and include sysdep.h and bfd.h early.
12+ * bfd-in2.h: Regenerate.
13+
14+2019-09-23 Alan Modra <amodra@gmail.com>
15+
316 * bfd-in.h: Move tic6x function declaration..
417 * elf32-tic6x.h: ..to here.
518 * bfd-in2.h: Regenerate.
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -763,143 +763,3 @@ union internal_auxent;
763763
764764 extern bfd_boolean bfd_coff_set_symbol_class
765765 (bfd *, struct bfd_symbol *, unsigned int);
766-
767-/* ARM VFP11 erratum workaround support. */
768-typedef enum
769-{
770- BFD_ARM_VFP11_FIX_DEFAULT,
771- BFD_ARM_VFP11_FIX_NONE,
772- BFD_ARM_VFP11_FIX_SCALAR,
773- BFD_ARM_VFP11_FIX_VECTOR
774-} bfd_arm_vfp11_fix;
775-
776-extern void bfd_elf32_arm_init_maps
777- (bfd *);
778-
779-extern void bfd_elf32_arm_set_vfp11_fix
780- (bfd *, struct bfd_link_info *);
781-
782-extern void bfd_elf32_arm_set_cortex_a8_fix
783- (bfd *, struct bfd_link_info *);
784-
785-extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
786- (bfd *, struct bfd_link_info *);
787-
788-extern void bfd_elf32_arm_vfp11_fix_veneer_locations
789- (bfd *, struct bfd_link_info *);
790-
791-/* ARM STM STM32L4XX erratum workaround support. */
792-typedef enum
793-{
794- BFD_ARM_STM32L4XX_FIX_NONE,
795- BFD_ARM_STM32L4XX_FIX_DEFAULT,
796- BFD_ARM_STM32L4XX_FIX_ALL
797-} bfd_arm_stm32l4xx_fix;
798-
799-extern void bfd_elf32_arm_set_stm32l4xx_fix
800- (bfd *, struct bfd_link_info *);
801-
802-extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
803- (bfd *, struct bfd_link_info *);
804-
805-extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
806- (bfd *, struct bfd_link_info *);
807-
808-/* ARM Interworking support. Called from linker. */
809-extern bfd_boolean bfd_arm_allocate_interworking_sections
810- (struct bfd_link_info *);
811-
812-extern bfd_boolean bfd_arm_process_before_allocation
813- (bfd *, struct bfd_link_info *, int);
814-
815-extern bfd_boolean bfd_arm_get_bfd_for_interworking
816- (bfd *, struct bfd_link_info *);
817-
818-/* PE ARM Interworking support. Called from linker. */
819-extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
820- (struct bfd_link_info *);
821-
822-extern bfd_boolean bfd_arm_pe_process_before_allocation
823- (bfd *, struct bfd_link_info *, int);
824-
825-extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
826- (bfd *, struct bfd_link_info *);
827-
828-/* ELF ARM Interworking support. Called from linker. */
829-extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
830- (struct bfd_link_info *);
831-
832-extern bfd_boolean bfd_elf32_arm_process_before_allocation
833- (bfd *, struct bfd_link_info *);
834-
835-struct elf32_arm_params {
836- char *thumb_entry_symbol;
837- int byteswap_code;
838- int target1_is_rel;
839- char * target2_type;
840- int fix_v4bx;
841- int use_blx;
842- bfd_arm_vfp11_fix vfp11_denorm_fix;
843- bfd_arm_stm32l4xx_fix stm32l4xx_fix;
844- int no_enum_size_warning;
845- int no_wchar_size_warning;
846- int pic_veneer;
847- int fix_cortex_a8;
848- int fix_arm1176;
849- int merge_exidx_entries;
850- int cmse_implib;
851- bfd *in_implib_bfd;
852-};
853-
854-void bfd_elf32_arm_set_target_params
855- (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
856-
857-extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
858- (bfd *, struct bfd_link_info *);
859-
860-extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
861- (bfd *, struct bfd_link_info *);
862-
863-extern void bfd_elf32_arm_keep_private_stub_output_sections
864- (struct bfd_link_info *);
865-
866-/* ELF ARM mapping symbol support. */
867-#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
868-#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
869-#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
870-#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
871-
872-extern bfd_boolean bfd_is_arm_special_symbol_name
873- (const char *, int);
874-
875-extern void bfd_elf32_arm_set_byteswap_code
876- (struct bfd_link_info *, int);
877-
878-extern void bfd_elf32_arm_use_long_plt (void);
879-
880-/* ARM Note section processing. */
881-extern bfd_boolean bfd_arm_merge_machines
882- (bfd *, bfd *);
883-
884-extern bfd_boolean bfd_arm_update_notes
885- (bfd *, const char *);
886-
887-extern unsigned int bfd_arm_get_mach_from_notes
888- (bfd *, const char *);
889-
890-/* ARM stub generation support. Called from the linker. */
891-extern int elf32_arm_setup_section_lists
892- (bfd *, struct bfd_link_info *);
893-extern void elf32_arm_next_input_section
894- (struct bfd_link_info *, struct bfd_section *);
895-extern bfd_boolean elf32_arm_size_stubs
896- (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
897- struct bfd_section * (*) (const char *, struct bfd_section *,
898- struct bfd_section *, unsigned int),
899- void (*) (void));
900-extern bfd_boolean elf32_arm_build_stubs
901- (struct bfd_link_info *);
902-
903-/* ARM unwind section editing support. */
904-extern bfd_boolean elf32_arm_fix_exidx_coverage
905-(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -770,146 +770,6 @@ union internal_auxent;
770770
771771 extern bfd_boolean bfd_coff_set_symbol_class
772772 (bfd *, struct bfd_symbol *, unsigned int);
773-
774-/* ARM VFP11 erratum workaround support. */
775-typedef enum
776-{
777- BFD_ARM_VFP11_FIX_DEFAULT,
778- BFD_ARM_VFP11_FIX_NONE,
779- BFD_ARM_VFP11_FIX_SCALAR,
780- BFD_ARM_VFP11_FIX_VECTOR
781-} bfd_arm_vfp11_fix;
782-
783-extern void bfd_elf32_arm_init_maps
784- (bfd *);
785-
786-extern void bfd_elf32_arm_set_vfp11_fix
787- (bfd *, struct bfd_link_info *);
788-
789-extern void bfd_elf32_arm_set_cortex_a8_fix
790- (bfd *, struct bfd_link_info *);
791-
792-extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
793- (bfd *, struct bfd_link_info *);
794-
795-extern void bfd_elf32_arm_vfp11_fix_veneer_locations
796- (bfd *, struct bfd_link_info *);
797-
798-/* ARM STM STM32L4XX erratum workaround support. */
799-typedef enum
800-{
801- BFD_ARM_STM32L4XX_FIX_NONE,
802- BFD_ARM_STM32L4XX_FIX_DEFAULT,
803- BFD_ARM_STM32L4XX_FIX_ALL
804-} bfd_arm_stm32l4xx_fix;
805-
806-extern void bfd_elf32_arm_set_stm32l4xx_fix
807- (bfd *, struct bfd_link_info *);
808-
809-extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
810- (bfd *, struct bfd_link_info *);
811-
812-extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
813- (bfd *, struct bfd_link_info *);
814-
815-/* ARM Interworking support. Called from linker. */
816-extern bfd_boolean bfd_arm_allocate_interworking_sections
817- (struct bfd_link_info *);
818-
819-extern bfd_boolean bfd_arm_process_before_allocation
820- (bfd *, struct bfd_link_info *, int);
821-
822-extern bfd_boolean bfd_arm_get_bfd_for_interworking
823- (bfd *, struct bfd_link_info *);
824-
825-/* PE ARM Interworking support. Called from linker. */
826-extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
827- (struct bfd_link_info *);
828-
829-extern bfd_boolean bfd_arm_pe_process_before_allocation
830- (bfd *, struct bfd_link_info *, int);
831-
832-extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
833- (bfd *, struct bfd_link_info *);
834-
835-/* ELF ARM Interworking support. Called from linker. */
836-extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
837- (struct bfd_link_info *);
838-
839-extern bfd_boolean bfd_elf32_arm_process_before_allocation
840- (bfd *, struct bfd_link_info *);
841-
842-struct elf32_arm_params {
843- char *thumb_entry_symbol;
844- int byteswap_code;
845- int target1_is_rel;
846- char * target2_type;
847- int fix_v4bx;
848- int use_blx;
849- bfd_arm_vfp11_fix vfp11_denorm_fix;
850- bfd_arm_stm32l4xx_fix stm32l4xx_fix;
851- int no_enum_size_warning;
852- int no_wchar_size_warning;
853- int pic_veneer;
854- int fix_cortex_a8;
855- int fix_arm1176;
856- int merge_exidx_entries;
857- int cmse_implib;
858- bfd *in_implib_bfd;
859-};
860-
861-void bfd_elf32_arm_set_target_params
862- (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
863-
864-extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
865- (bfd *, struct bfd_link_info *);
866-
867-extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
868- (bfd *, struct bfd_link_info *);
869-
870-extern void bfd_elf32_arm_keep_private_stub_output_sections
871- (struct bfd_link_info *);
872-
873-/* ELF ARM mapping symbol support. */
874-#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
875-#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
876-#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
877-#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
878-
879-extern bfd_boolean bfd_is_arm_special_symbol_name
880- (const char *, int);
881-
882-extern void bfd_elf32_arm_set_byteswap_code
883- (struct bfd_link_info *, int);
884-
885-extern void bfd_elf32_arm_use_long_plt (void);
886-
887-/* ARM Note section processing. */
888-extern bfd_boolean bfd_arm_merge_machines
889- (bfd *, bfd *);
890-
891-extern bfd_boolean bfd_arm_update_notes
892- (bfd *, const char *);
893-
894-extern unsigned int bfd_arm_get_mach_from_notes
895- (bfd *, const char *);
896-
897-/* ARM stub generation support. Called from the linker. */
898-extern int elf32_arm_setup_section_lists
899- (bfd *, struct bfd_link_info *);
900-extern void elf32_arm_next_input_section
901- (struct bfd_link_info *, struct bfd_section *);
902-extern bfd_boolean elf32_arm_size_stubs
903- (bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma,
904- struct bfd_section * (*) (const char *, struct bfd_section *,
905- struct bfd_section *, unsigned int),
906- void (*) (void));
907-extern bfd_boolean elf32_arm_build_stubs
908- (struct bfd_link_info *);
909-
910-/* ARM unwind section editing support. */
911-extern bfd_boolean elf32_arm_fix_exidx_coverage
912-(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
913773 /* Extracted from init.c. */
914774 unsigned int bfd_init (void);
915775
--- a/bfd/coff-arm.c
+++ b/bfd/coff-arm.c
@@ -24,6 +24,8 @@
2424 #include "libbfd.h"
2525 #include "coff/arm.h"
2626 #include "coff/internal.h"
27+#include "cpu-arm.h"
28+#include "coff-arm.h"
2729
2830 #ifdef COFF_WITH_PE
2931 #include "coff/pe.h"
--- /dev/null
+++ b/bfd/coff-arm.h
@@ -0,0 +1,29 @@
1+/* BFD back-end for ARM COFF files.
2+ Copyright (C) 2019 Free Software Foundation, Inc.
3+
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+/* ARM Interworking support. Called from linker. */
22+extern bfd_boolean bfd_arm_allocate_interworking_sections
23+ (struct bfd_link_info *);
24+
25+extern bfd_boolean bfd_arm_process_before_allocation
26+ (bfd *, struct bfd_link_info *, int);
27+
28+extern bfd_boolean bfd_arm_get_bfd_for_interworking
29+ (bfd *, struct bfd_link_info *);
--- a/bfd/cpu-arm.c
+++ b/bfd/cpu-arm.c
@@ -23,6 +23,7 @@
2323 #include "bfd.h"
2424 #include "libbfd.h"
2525 #include "libiberty.h"
26+#include "cpu-arm.h"
2627
2728 /* This routine is provided two arch_infos and works out which ARM
2829 machine which would be compatible with both and returns a pointer
--- /dev/null
+++ b/bfd/cpu-arm.h
@@ -0,0 +1,39 @@
1+/* BFD support for the ARM processor
2+ Copyright (C) 2019 Free Software Foundation, Inc.
3+
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+/* ARM Note section processing. */
22+extern bfd_boolean bfd_arm_merge_machines
23+ (bfd *, bfd *);
24+
25+extern bfd_boolean bfd_arm_update_notes
26+ (bfd *, const char *);
27+
28+extern unsigned int bfd_arm_get_mach_from_notes
29+ (bfd *, const char *);
30+
31+/* ELF ARM mapping symbol support. */
32+#define BFD_ARM_SPECIAL_SYM_TYPE_MAP (1 << 0)
33+#define BFD_ARM_SPECIAL_SYM_TYPE_TAG (1 << 1)
34+#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER (1 << 2)
35+#define BFD_ARM_SPECIAL_SYM_TYPE_ANY (~0)
36+
37+extern bfd_boolean bfd_is_arm_special_symbol_name
38+ (const char *, int);
39+
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -28,6 +28,8 @@
2828 #include "elf-nacl.h"
2929 #include "elf-vxworks.h"
3030 #include "elf/arm.h"
31+#include "elf32-arm.h"
32+#include "cpu-arm.h"
3133
3234 /* Return the relocation section associated with NAME. HTAB is the
3335 bfd's elf32_arm_link_hash_entry. */
--- /dev/null
+++ b/bfd/elf32-arm.h
@@ -0,0 +1,121 @@
1+/* 32-bit ELF support for ARM
2+ Copyright (C) 2019 Free Software Foundation, Inc.
3+
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. */
23+typedef 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+
31+extern void bfd_elf32_arm_init_maps
32+ (bfd *);
33+
34+extern void bfd_elf32_arm_set_vfp11_fix
35+ (bfd *, struct bfd_link_info *);
36+
37+extern void bfd_elf32_arm_set_cortex_a8_fix
38+ (bfd *, struct bfd_link_info *);
39+
40+extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
41+ (bfd *, struct bfd_link_info *);
42+
43+extern void bfd_elf32_arm_vfp11_fix_veneer_locations
44+ (bfd *, struct bfd_link_info *);
45+
46+/* ARM STM STM32L4XX erratum workaround support. */
47+typedef 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+
54+extern void bfd_elf32_arm_set_stm32l4xx_fix
55+ (bfd *, struct bfd_link_info *);
56+
57+extern bfd_boolean bfd_elf32_arm_stm32l4xx_erratum_scan
58+ (bfd *, struct bfd_link_info *);
59+
60+extern void bfd_elf32_arm_stm32l4xx_fix_veneer_locations
61+ (bfd *, struct bfd_link_info *);
62+
63+/* ELF ARM Interworking support. Called from linker. */
64+extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
65+ (struct bfd_link_info *);
66+
67+extern bfd_boolean bfd_elf32_arm_process_before_allocation
68+ (bfd *, struct bfd_link_info *);
69+
70+struct 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+
89+void bfd_elf32_arm_set_target_params
90+ (bfd *, struct bfd_link_info *, struct elf32_arm_params *);
91+
92+extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
93+ (bfd *, struct bfd_link_info *);
94+
95+extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
96+ (bfd *, struct bfd_link_info *);
97+
98+extern void bfd_elf32_arm_keep_private_stub_output_sections
99+ (struct bfd_link_info *);
100+
101+extern void bfd_elf32_arm_set_byteswap_code
102+ (struct bfd_link_info *, int);
103+
104+extern void bfd_elf32_arm_use_long_plt (void);
105+
106+/* ARM stub generation support. Called from the linker. */
107+extern int elf32_arm_setup_section_lists
108+ (bfd *, struct bfd_link_info *);
109+extern void elf32_arm_next_input_section
110+ (struct bfd_link_info *, struct bfd_section *);
111+extern bfd_boolean elf32_arm_size_stubs
112+ (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));
116+extern bfd_boolean elf32_arm_build_stubs
117+ (struct bfd_link_info *);
118+
119+/* ARM unwind section editing support. */
120+extern bfd_boolean elf32_arm_fix_exidx_coverage
121+(struct bfd_section **, unsigned int, struct bfd_link_info *, bfd_boolean);
--- a/bfd/pe-arm-wince.c
+++ b/bfd/pe-arm-wince.c
@@ -18,6 +18,9 @@
1818 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1919 MA 02110-1301, USA. */
2020
21+#include "sysdep.h"
22+#include "bfd.h"
23+
2124 #define TARGET_UNDERSCORE 0
2225 #define USER_LABEL_PREFIX ""
2326
@@ -26,6 +29,11 @@
2629 #define TARGET_BIG_SYM arm_pe_wince_be_vec
2730 #define TARGET_BIG_NAME "pe-arm-wince-big"
2831
32+#define LOCAL_LABEL_PREFIX "."
33+
34+#undef bfd_pe_print_pdata
35+#define bfd_pe_print_pdata _bfd_pe_print_ce_compressed_pdata
36+
2937 #define bfd_arm_allocate_interworking_sections \
3038 bfd_arm_wince_pe_allocate_interworking_sections
3139 #define bfd_arm_get_bfd_for_interworking \
@@ -33,13 +41,4 @@
3341 #define bfd_arm_process_before_allocation \
3442 bfd_arm_wince_pe_process_before_allocation
3543
36-#define LOCAL_LABEL_PREFIX "."
37-
38-#include "sysdep.h"
39-#include "bfd.h"
40-
41-#undef bfd_pe_print_pdata
42-#define bfd_pe_print_pdata _bfd_pe_print_ce_compressed_pdata
43-
4444 #include "pe-arm.c"
45-
--- a/bfd/pe-arm.c
+++ b/bfd/pe-arm.c
@@ -18,18 +18,6 @@
1818 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1919 MA 02110-1301, USA. */
2020
21-
22-/* Do this before including bfd.h, so we prototype the right functions. */
23-
24-#ifndef bfd_arm_allocate_interworking_sections
25-#define bfd_arm_allocate_interworking_sections \
26- bfd_armpe_allocate_interworking_sections
27-#define bfd_arm_get_bfd_for_interworking \
28- bfd_armpe_get_bfd_for_interworking
29-#define bfd_arm_process_before_allocation \
30- bfd_armpe_process_before_allocation
31-#endif
32-
3321 #include "sysdep.h"
3422 #include "bfd.h"
3523
@@ -64,4 +52,13 @@
6452 { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
6553 COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
6654
55+#ifndef bfd_arm_allocate_interworking_sections
56+#define bfd_arm_allocate_interworking_sections \
57+ bfd_armpe_allocate_interworking_sections
58+#define bfd_arm_get_bfd_for_interworking \
59+ bfd_armpe_get_bfd_for_interworking
60+#define bfd_arm_process_before_allocation \
61+ bfd_armpe_process_before_allocation
62+#endif
63+
6764 #include "coff-arm.c"
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,7 @@
1+2019-09-23 Alan Modra <amodra@gmail.com>
2+
3+ * config/tc-arm.c: Include cpu-arm.h.
4+
15 2019-09-21 Alan Modra <amodra@gmail.com>
26
37 * config/tc-i386.c (md_parse_option): Fix warning on vexwig assignment.
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -32,6 +32,7 @@
3232 #include "obstack.h"
3333 #include "libiberty.h"
3434 #include "opcode/arm.h"
35+#include "cpu-arm.h"
3536
3637 #ifdef OBJ_ELF
3738 #include "elf/arm.h"
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
11 2019-09-23 Alan Modra <amodra@gmail.com>
22
3+ * emultempl/armelf.em: Include elf32-arm.h.
4+ * emultempl/pe.em: Move func defines later and include coff-arm.h.
5+
6+2019-09-23 Alan Modra <amodra@gmail.com>
7+
38 * emultempl/aarch64elf.em: Include elfxx-aarch64.h.
49
510 2019-09-23 Alan Modra <amodra@gmail.com>
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -27,6 +27,7 @@ fragment <<EOF
2727
2828 #include "ldctor.h"
2929 #include "elf/arm.h"
30+#include "elf32-arm.h"
3031
3132 static struct elf32_arm_params params =
3233 {
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -37,18 +37,6 @@ fragment <<EOF
3737
3838 #define TARGET_IS_${EMULATION_NAME}
3939
40-/* Do this before including bfd.h, so we prototype the right functions. */
41-
42-#if defined(TARGET_IS_armpe) \
43- || defined(TARGET_IS_arm_wince_pe)
44-#define bfd_arm_allocate_interworking_sections \
45- bfd_${EMULATION_NAME}_allocate_interworking_sections
46-#define bfd_arm_get_bfd_for_interworking \
47- bfd_${EMULATION_NAME}_get_bfd_for_interworking
48-#define bfd_arm_process_before_allocation \
49- bfd_${EMULATION_NAME}_process_before_allocation
50-#endif
51-
5240 #include "sysdep.h"
5341 #include "bfd.h"
5442 #include "bfdlink.h"
@@ -78,6 +66,17 @@ fragment <<EOF
7866 #include "../bfd/libcoff.h"
7967 #include "../bfd/libpei.h"
8068
69+#if defined(TARGET_IS_armpe) \
70+ || defined(TARGET_IS_arm_wince_pe)
71+#define bfd_arm_allocate_interworking_sections \
72+ bfd_${EMULATION_NAME}_allocate_interworking_sections
73+#define bfd_arm_get_bfd_for_interworking \
74+ bfd_${EMULATION_NAME}_get_bfd_for_interworking
75+#define bfd_arm_process_before_allocation \
76+ bfd_${EMULATION_NAME}_process_before_allocation
77+#include "coff-arm.h"
78+#endif
79+
8180 #include "deffile.h"
8281 #include "pe-dll.h"
8382 #include "safe-ctype.h"