GNU Binutils with patches for OS216
Revision | bc46edd312aa3e231964b51329ac612c91ef34c2 (tree) |
---|---|
Time | 2006-11-30 23:49:43 |
Author | Kazu Hirata <kazu@code...> |
Commiter | Kazu Hirata |
bfd/
* archures.c (bfd_mach_cpu32_fido): New.
(bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_a,
bfd_mach_mcf_isa_a_mac, bfd_mach_mcf_isa_a_emac,
bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_b_nousp,
bfd_mach_mcf_isa_b_nousp_mac, bfd_mach_mcf_isa_b_nousp_emac,
bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac,
bfd_mach_mcf_isa_b_emac, bfd_mach_mcf_isa_b_float,
bfd_mach_mcf_isa_b_float_mac, bfd_mach_mcf_isa_b_float_emac):
Increment the defined values.
* cpu-m68k.c (arch_info_struct): Add en entry for
bfd_mach_cpu32_fido.
(m68k_arch_features): Add an entry corresponding to
bfd_mach_cpu32_fido.
(bfd_m68k_compatible): Handle bfd_mach_cpu32_fido.
* elf32-m68k.c (elf32_m68k_object_p): Handle
EF_M68K_CPU32_FIDO_A.
(elf32_m68k_merge_private_bfd_data): Use EF_M68K_CPU32_MASK.
(elf32_m68k_print_private_bfd_data): Handle
EF_M68K_CPU32_FIDO_A.
binutils/
* readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A.
gas/
* config/tc-m68k.c (m68k_elf_final_processing): Handle
EF_M68K_CPU32_FIDO_A.
include/
* include/elf/m68k.h (EF_M68K_CPU32_FIDO_A,
EF_M68K_CPU32_MASK): New.
@@ -1,3 +1,38 @@ | ||
1 | +2006-11-30 Kazu Hirata <kazu@codesourcery.com> | |
2 | + | |
3 | + bfd/ | |
4 | + * archures.c (bfd_mach_cpu32_fido): New. | |
5 | + (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_a, | |
6 | + bfd_mach_mcf_isa_a_mac, bfd_mach_mcf_isa_a_emac, | |
7 | + bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac, | |
8 | + bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_b_nousp, | |
9 | + bfd_mach_mcf_isa_b_nousp_mac, bfd_mach_mcf_isa_b_nousp_emac, | |
10 | + bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, | |
11 | + bfd_mach_mcf_isa_b_emac, bfd_mach_mcf_isa_b_float, | |
12 | + bfd_mach_mcf_isa_b_float_mac, bfd_mach_mcf_isa_b_float_emac): | |
13 | + Increment the defined values. | |
14 | + * cpu-m68k.c (arch_info_struct): Add en entry for | |
15 | + bfd_mach_cpu32_fido. | |
16 | + (m68k_arch_features): Add an entry corresponding to | |
17 | + bfd_mach_cpu32_fido. | |
18 | + (bfd_m68k_compatible): Handle bfd_mach_cpu32_fido. | |
19 | + * elf32-m68k.c (elf32_m68k_object_p): Handle | |
20 | + EF_M68K_CPU32_FIDO_A. | |
21 | + (elf32_m68k_merge_private_bfd_data): Use EF_M68K_CPU32_MASK. | |
22 | + (elf32_m68k_print_private_bfd_data): Handle | |
23 | + EF_M68K_CPU32_FIDO_A. | |
24 | + | |
25 | + binutils/ | |
26 | + * readelf.c (get_machine_flags): Handle EF_M68K_CPU32_FIDO_A. | |
27 | + | |
28 | + gas/ | |
29 | + * config/tc-m68k.c (m68k_elf_final_processing): Handle | |
30 | + EF_M68K_CPU32_FIDO_A. | |
31 | + | |
32 | + include/ | |
33 | + * include/elf/m68k.h (EF_M68K_CPU32_FIDO_A, | |
34 | + EF_M68K_CPU32_MASK): New. | |
35 | + | |
1 | 36 | 2006-11-29 Daniel Jacobowitz <dan@codesourcery.com> |
2 | 37 | |
3 | 38 | Backport: |
@@ -80,22 +80,23 @@ DESCRIPTION | ||
80 | 80 | .#define bfd_mach_m68040 6 |
81 | 81 | .#define bfd_mach_m68060 7 |
82 | 82 | .#define bfd_mach_cpu32 8 |
83 | -.#define bfd_mach_mcf_isa_a_nodiv 9 | |
84 | -.#define bfd_mach_mcf_isa_a 10 | |
85 | -.#define bfd_mach_mcf_isa_a_mac 11 | |
86 | -.#define bfd_mach_mcf_isa_a_emac 12 | |
87 | -.#define bfd_mach_mcf_isa_aplus 13 | |
88 | -.#define bfd_mach_mcf_isa_aplus_mac 14 | |
89 | -.#define bfd_mach_mcf_isa_aplus_emac 15 | |
90 | -.#define bfd_mach_mcf_isa_b_nousp 16 | |
91 | -.#define bfd_mach_mcf_isa_b_nousp_mac 17 | |
92 | -.#define bfd_mach_mcf_isa_b_nousp_emac 18 | |
93 | -.#define bfd_mach_mcf_isa_b 19 | |
94 | -.#define bfd_mach_mcf_isa_b_mac 20 | |
95 | -.#define bfd_mach_mcf_isa_b_emac 21 | |
96 | -.#define bfd_mach_mcf_isa_b_float 22 | |
97 | -.#define bfd_mach_mcf_isa_b_float_mac 23 | |
98 | -.#define bfd_mach_mcf_isa_b_float_emac 24 | |
83 | +.#define bfd_mach_cpu32_fido 9 | |
84 | +.#define bfd_mach_mcf_isa_a_nodiv 10 | |
85 | +.#define bfd_mach_mcf_isa_a 11 | |
86 | +.#define bfd_mach_mcf_isa_a_mac 12 | |
87 | +.#define bfd_mach_mcf_isa_a_emac 13 | |
88 | +.#define bfd_mach_mcf_isa_aplus 14 | |
89 | +.#define bfd_mach_mcf_isa_aplus_mac 15 | |
90 | +.#define bfd_mach_mcf_isa_aplus_emac 16 | |
91 | +.#define bfd_mach_mcf_isa_b_nousp 17 | |
92 | +.#define bfd_mach_mcf_isa_b_nousp_mac 18 | |
93 | +.#define bfd_mach_mcf_isa_b_nousp_emac 19 | |
94 | +.#define bfd_mach_mcf_isa_b 20 | |
95 | +.#define bfd_mach_mcf_isa_b_mac 21 | |
96 | +.#define bfd_mach_mcf_isa_b_emac 22 | |
97 | +.#define bfd_mach_mcf_isa_b_float 23 | |
98 | +.#define bfd_mach_mcf_isa_b_float_mac 24 | |
99 | +.#define bfd_mach_mcf_isa_b_float_emac 25 | |
99 | 100 | . bfd_arch_vax, {* DEC Vax *} |
100 | 101 | . bfd_arch_i960, {* Intel 960 *} |
101 | 102 | . {* The order of the following is important. |
@@ -41,53 +41,54 @@ static const bfd_arch_info_type arch_info_struct[] = | ||
41 | 41 | N(bfd_mach_m68040, "m68k:68040", FALSE, &arch_info_struct[6]), |
42 | 42 | N(bfd_mach_m68060, "m68k:68060", FALSE, &arch_info_struct[7]), |
43 | 43 | N(bfd_mach_cpu32, "m68k:cpu32", FALSE, &arch_info_struct[8]), |
44 | + N(bfd_mach_cpu32_fido, "m68k:fido", FALSE, &arch_info_struct[9]), | |
44 | 45 | |
45 | 46 | /* Various combinations of CF architecture features */ |
46 | 47 | N(bfd_mach_mcf_isa_a_nodiv, "m68k:isa-a:nodiv", |
47 | - FALSE, &arch_info_struct[9]), | |
48 | - N(bfd_mach_mcf_isa_a, "m68k:isa-a", | |
49 | 48 | FALSE, &arch_info_struct[10]), |
50 | - N(bfd_mach_mcf_isa_a_mac, "m68k:isa-a:mac", | |
49 | + N(bfd_mach_mcf_isa_a, "m68k:isa-a", | |
51 | 50 | FALSE, &arch_info_struct[11]), |
52 | - N(bfd_mach_mcf_isa_a_emac, "m68k:isa-a:emac", | |
51 | + N(bfd_mach_mcf_isa_a_mac, "m68k:isa-a:mac", | |
53 | 52 | FALSE, &arch_info_struct[12]), |
54 | - N(bfd_mach_mcf_isa_aplus, "m68k:isa-aplus", | |
53 | + N(bfd_mach_mcf_isa_a_emac, "m68k:isa-a:emac", | |
55 | 54 | FALSE, &arch_info_struct[13]), |
56 | - N(bfd_mach_mcf_isa_aplus_mac, "m68k:isa-aplus:mac", | |
55 | + N(bfd_mach_mcf_isa_aplus, "m68k:isa-aplus", | |
57 | 56 | FALSE, &arch_info_struct[14]), |
58 | - N(bfd_mach_mcf_isa_aplus_emac, "m68k:isa-aplus:emac", | |
57 | + N(bfd_mach_mcf_isa_aplus_mac, "m68k:isa-aplus:mac", | |
59 | 58 | FALSE, &arch_info_struct[15]), |
60 | - N(bfd_mach_mcf_isa_b_nousp, "m68k:isa-b:nousp", | |
59 | + N(bfd_mach_mcf_isa_aplus_emac, "m68k:isa-aplus:emac", | |
61 | 60 | FALSE, &arch_info_struct[16]), |
62 | - N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:isa-b:nousp:mac", | |
61 | + N(bfd_mach_mcf_isa_b_nousp, "m68k:isa-b:nousp", | |
63 | 62 | FALSE, &arch_info_struct[17]), |
64 | - N(bfd_mach_mcf_isa_b_nousp_emac, "m68k:isa-b:nousp:emac", | |
63 | + N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:isa-b:nousp:mac", | |
65 | 64 | FALSE, &arch_info_struct[18]), |
66 | - N(bfd_mach_mcf_isa_b, "m68k:isa-b", | |
65 | + N(bfd_mach_mcf_isa_b_nousp_emac, "m68k:isa-b:nousp:emac", | |
67 | 66 | FALSE, &arch_info_struct[19]), |
68 | - N(bfd_mach_mcf_isa_b_mac, "m68k:isa-b:mac", | |
67 | + N(bfd_mach_mcf_isa_b, "m68k:isa-b", | |
69 | 68 | FALSE, &arch_info_struct[20]), |
70 | - N(bfd_mach_mcf_isa_b_emac, "m68k:isa-b:emac", | |
69 | + N(bfd_mach_mcf_isa_b_mac, "m68k:isa-b:mac", | |
71 | 70 | FALSE, &arch_info_struct[21]), |
72 | - N(bfd_mach_mcf_isa_b_float, "m68k:isa-b:float", | |
71 | + N(bfd_mach_mcf_isa_b_emac, "m68k:isa-b:emac", | |
73 | 72 | FALSE, &arch_info_struct[22]), |
74 | - N(bfd_mach_mcf_isa_b_float_mac, "m68k:isa-b:float:mac", | |
73 | + N(bfd_mach_mcf_isa_b_float, "m68k:isa-b:float", | |
75 | 74 | FALSE, &arch_info_struct[23]), |
76 | - N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac", | |
75 | + N(bfd_mach_mcf_isa_b_float_mac, "m68k:isa-b:float:mac", | |
77 | 76 | FALSE, &arch_info_struct[24]), |
77 | + N(bfd_mach_mcf_isa_b_float_emac, "m68k:isa-b:float:emac", | |
78 | + FALSE, &arch_info_struct[25]), | |
78 | 79 | |
79 | 80 | /* Legacy names for CF architectures */ |
80 | - N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[25]), | |
81 | - N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[26]), | |
82 | - N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[27]), | |
83 | - N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[28]), | |
84 | - N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[29]), | |
85 | - N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[30]), | |
86 | - N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[31]), | |
81 | + N(bfd_mach_mcf_isa_a_nodiv, "m68k:5200", FALSE, &arch_info_struct[26]), | |
82 | + N(bfd_mach_mcf_isa_a_mac,"m68k:5206e", FALSE, &arch_info_struct[27]), | |
83 | + N(bfd_mach_mcf_isa_a_mac, "m68k:5307", FALSE, &arch_info_struct[28]), | |
84 | + N(bfd_mach_mcf_isa_b_nousp_mac, "m68k:5407", FALSE, &arch_info_struct[29]), | |
85 | + N(bfd_mach_mcf_isa_aplus_emac, "m68k:528x", FALSE, &arch_info_struct[30]), | |
86 | + N(bfd_mach_mcf_isa_aplus_emac, "m68k:521x", FALSE, &arch_info_struct[31]), | |
87 | + N(bfd_mach_mcf_isa_a_emac, "m68k:5249", FALSE, &arch_info_struct[32]), | |
87 | 88 | N(bfd_mach_mcf_isa_b_float_emac, "m68k:547x", |
88 | - FALSE, &arch_info_struct[32]), | |
89 | - N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x", | |
90 | 89 | FALSE, &arch_info_struct[33]), |
90 | + N(bfd_mach_mcf_isa_b_float_emac, "m68k:548x", | |
91 | + FALSE, &arch_info_struct[34]), | |
91 | 92 | N(bfd_mach_mcf_isa_b_float_emac, "m68k:cfv4e", FALSE, 0), |
92 | 93 | }; |
93 | 94 |
@@ -107,6 +108,7 @@ static const unsigned m68k_arch_features[] = | ||
107 | 108 | m68040|m68881|m68851, |
108 | 109 | m68060|m68881|m68851, |
109 | 110 | cpu32|m68881, |
111 | + cpu32|m68881|fido_a, | |
110 | 112 | mcfisa_a, |
111 | 113 | mcfisa_a|mcfhwdiv, |
112 | 114 | mcfisa_a|mcfhwdiv|mcfmac, |
@@ -202,16 +204,16 @@ bfd_m68k_compatible (const bfd_arch_info_type *a, | ||
202 | 204 | if (a->mach <= bfd_mach_m68060 && b->mach <= bfd_mach_m68060) |
203 | 205 | /* Merge m68k machine. */ |
204 | 206 | return a->mach > b->mach ? a : b; |
205 | - else if (a->mach == bfd_mach_cpu32 && b->mach == bfd_mach_cpu32) | |
206 | - /* CPU32 is compatible with itself. */ | |
207 | - return a; | |
208 | - else if (a->mach >= bfd_mach_mcf_isa_a_nodiv | |
209 | - && b->mach >= bfd_mach_mcf_isa_a_nodiv) | |
207 | + else if (a->mach >= bfd_mach_cpu32 && b->mach >= bfd_mach_cpu32) | |
210 | 208 | { |
211 | - /* Merge cf machine. */ | |
209 | + /* Merge the machine features. */ | |
212 | 210 | unsigned features = (bfd_m68k_mach_to_features (a->mach) |
213 | 211 | | bfd_m68k_mach_to_features (b->mach)); |
214 | 212 | |
213 | + /* CPU32 and Coldfire are incompatible. */ | |
214 | + if ((~features & (cpu32 | mcfisa_a)) == 0) | |
215 | + return NULL; | |
216 | + | |
215 | 217 | /* ISA A+ and ISA B are incompatible. */ |
216 | 218 | if ((~features & (mcfisa_aa | mcfisa_b)) == 0) |
217 | 219 | return NULL; |
@@ -444,7 +444,14 @@ elf32_m68k_object_p (bfd *abfd) | ||
444 | 444 | if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) |
445 | 445 | features |= m68000; |
446 | 446 | else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) |
447 | - features |= cpu32; | |
447 | + { | |
448 | + features |= cpu32; | |
449 | + switch (eflags & EF_M68K_CPU32_MASK) | |
450 | + { | |
451 | + case EF_M68K_CPU32_FIDO_A: | |
452 | + features |= fido_a; break; | |
453 | + } | |
454 | + } | |
448 | 455 | else |
449 | 456 | { |
450 | 457 | switch (eflags & EF_M68K_CF_ISA_MASK) |
@@ -535,7 +542,7 @@ elf32_m68k_merge_private_bfd_data (ibfd, obfd) | ||
535 | 542 | if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) |
536 | 543 | variant_mask = 0; |
537 | 544 | else if ((in_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) |
538 | - variant_mask = 0; | |
545 | + variant_mask = EF_M68K_CPU32_MASK; | |
539 | 546 | else |
540 | 547 | variant_mask = EF_M68K_CF_ISA_MASK; |
541 | 548 |
@@ -572,7 +579,11 @@ elf32_m68k_print_private_bfd_data (abfd, ptr) | ||
572 | 579 | if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) |
573 | 580 | fprintf (file, " [m68000]"); |
574 | 581 | else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) |
575 | - fprintf (file, " [cpu32]"); | |
582 | + { | |
583 | + fprintf (file, " [cpu32]"); | |
584 | + if (eflags & EF_M68K_CPU32_FIDO_A) | |
585 | + fprintf (file, " [fido]"); | |
586 | + } | |
576 | 587 | else |
577 | 588 | { |
578 | 589 | if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) |
@@ -1951,7 +1951,11 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) | ||
1951 | 1951 | if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) |
1952 | 1952 | strcat (buf, ", m68000"); |
1953 | 1953 | else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) |
1954 | - strcat (buf, ", cpu32"); | |
1954 | + { | |
1955 | + strcat (buf, ", cpu32"); | |
1956 | + if (e_flags & EF_M68K_CPU32_FIDO_A) | |
1957 | + strcat (buf, ", fido_a"); | |
1958 | + } | |
1955 | 1959 | else |
1956 | 1960 | { |
1957 | 1961 | char const *isa = _("unknown"); |
@@ -7552,7 +7552,11 @@ m68k_elf_final_processing (void) | ||
7552 | 7552 | flags |= EF_M68K_CFV4E; |
7553 | 7553 | /* Set file-specific flags if this is a cpu32 processor. */ |
7554 | 7554 | if (cpu_of_arch (current_architecture) & cpu32) |
7555 | - flags |= EF_M68K_CPU32; | |
7555 | + { | |
7556 | + flags |= EF_M68K_CPU32; | |
7557 | + if (cpu_of_arch (current_architecture) & fido_a) | |
7558 | + flags |= EF_M68K_CPU32_FIDO_A; | |
7559 | + } | |
7556 | 7560 | else if ((cpu_of_arch (current_architecture) & m68000up) |
7557 | 7561 | && !(cpu_of_arch (current_architecture) & m68020up)) |
7558 | 7562 | flags |= EF_M68K_M68000; |
@@ -76,4 +76,10 @@ END_RELOC_NUMBERS (R_68K_max) | ||
76 | 76 | #define EF_M68K_CF_FLOAT 0x40 /* Has float insns */ |
77 | 77 | #define EF_M68K_CF_MASK 0xFF |
78 | 78 | |
79 | +/* We use the bottom 8 bits to encode information about the | |
80 | + CPU32 variant. If we use any of these bits, the top 24 bits must | |
81 | + be EF_M68K_CPU32. */ | |
82 | +#define EF_M68K_CPU32_FIDO_A 0x01 | |
83 | +#define EF_M68K_CPU32_MASK 0xFF | |
84 | + | |
79 | 85 | #endif |