GNU Binutils with patches for OS216
Revision | 8880056ce04c7d4c8a0d54e51dda8bd751c55304 (tree) |
---|---|
Time | 2006-11-28 23:09:50 |
Author | Kazu Hirata <kazu@code...> |
Commiter | Kazu Hirata |
bfd/
* elf32-m68k.c (elf32_m68k_object_p,
elf32_m68k_print_private_bfd_data): Use EF_M68K_ARCH_MASK to
extract architecture mask.
binutils/
* readelf.c (get_machine_flags): Use EF_M68K_ARCH_MASK to
extract architecture mask.
include/elf/
* m68k.h (EF_M68K_ARCH_MASK): New.
@@ -1,3 +1,17 @@ | ||
1 | +2006-11-28 Kazu Hirata <kazu@codesourcery.com> | |
2 | + | |
3 | + bfd/ | |
4 | + * elf32-m68k.c (elf32_m68k_object_p, | |
5 | + elf32_m68k_print_private_bfd_data): Use EF_M68K_ARCH_MASK to | |
6 | + extract architecture mask. | |
7 | + | |
8 | + binutils/ | |
9 | + * readelf.c (get_machine_flags): Use EF_M68K_ARCH_MASK to | |
10 | + extract architecture mask. | |
11 | + | |
12 | + include/elf/ | |
13 | + * m68k.h (EF_M68K_ARCH_MASK): New. | |
14 | + | |
1 | 15 | 2006-11-19 Nathan Sidwell <nathan@codesourcery.com> |
2 | 16 | |
3 | 17 | opcodes/ |
@@ -441,11 +441,13 @@ elf32_m68k_object_p (bfd *abfd) | ||
441 | 441 | unsigned features = 0; |
442 | 442 | flagword eflags = elf_elfheader (abfd)->e_flags; |
443 | 443 | |
444 | - if (eflags & EF_M68K_M68000) | |
444 | + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) | |
445 | 445 | features |= m68000; |
446 | - else if (eflags & EF_M68K_CPU32) | |
446 | + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) | |
447 | 447 | features |= cpu32; |
448 | - else if (eflags & EF_M68K_CF_ISA_MASK) | |
448 | + else if (((eflags & EF_M68K_ARCH_MASK) == 0 | |
449 | + && (eflags & EF_M68K_CF_ISA_MASK) != 0) | |
450 | + || (eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) | |
449 | 451 | { |
450 | 452 | switch (eflags & EF_M68K_CF_ISA_MASK) |
451 | 453 | { |
@@ -560,58 +562,61 @@ elf32_m68k_print_private_bfd_data (abfd, ptr) | ||
560 | 562 | /* xgettext:c-format */ |
561 | 563 | fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); |
562 | 564 | |
563 | - if (eflags & EF_M68K_CPU32) | |
564 | - fprintf (file, " [cpu32]"); | |
565 | - | |
566 | - if (eflags & EF_M68K_M68000) | |
565 | + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) | |
567 | 566 | fprintf (file, " [m68000]"); |
568 | - | |
569 | - if (eflags & EF_M68K_CFV4E) | |
570 | - fprintf (file, " [cfv4e]"); | |
571 | - | |
572 | - if (eflags & EF_M68K_CF_ISA_MASK) | |
567 | + else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) | |
568 | + fprintf (file, " [cpu32]"); | |
569 | + else if (((eflags & EF_M68K_ARCH_MASK) == 0 | |
570 | + && (eflags & EF_M68K_CF_ISA_MASK) != 0) | |
571 | + || (eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) | |
573 | 572 | { |
574 | - char const *isa = _("unknown"); | |
575 | - char const *mac = _("unknown"); | |
576 | - char const *additional = ""; | |
577 | - | |
578 | - switch (eflags & EF_M68K_CF_ISA_MASK) | |
579 | - { | |
580 | - case EF_M68K_CF_ISA_A_NODIV: | |
581 | - isa = "A"; | |
582 | - additional = " [nodiv]"; | |
583 | - break; | |
584 | - case EF_M68K_CF_ISA_A: | |
585 | - isa = "A"; | |
586 | - break; | |
587 | - case EF_M68K_CF_ISA_A_PLUS: | |
588 | - isa = "A+"; | |
589 | - break; | |
590 | - case EF_M68K_CF_ISA_B_NOUSP: | |
591 | - isa = "B"; | |
592 | - additional = " [nousp]"; | |
593 | - break; | |
594 | - case EF_M68K_CF_ISA_B: | |
595 | - isa = "B"; | |
596 | - break; | |
597 | - } | |
598 | - fprintf (file, " [isa %s]%s", isa, additional); | |
599 | - if (eflags & EF_M68K_CF_FLOAT) | |
600 | - fprintf (file, " [float]"); | |
601 | - switch (eflags & EF_M68K_CF_MAC_MASK) | |
573 | + if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) | |
574 | + fprintf (file, " [cfv4e]"); | |
575 | + | |
576 | + if (eflags & EF_M68K_CF_ISA_MASK) | |
602 | 577 | { |
603 | - case 0: | |
604 | - mac = NULL; | |
605 | - break; | |
606 | - case EF_M68K_CF_MAC: | |
607 | - mac = "mac"; | |
608 | - break; | |
609 | - case EF_M68K_CF_EMAC: | |
610 | - mac = "emac"; | |
611 | - break; | |
578 | + char const *isa = _("unknown"); | |
579 | + char const *mac = _("unknown"); | |
580 | + char const *additional = ""; | |
581 | + | |
582 | + switch (eflags & EF_M68K_CF_ISA_MASK) | |
583 | + { | |
584 | + case EF_M68K_CF_ISA_A_NODIV: | |
585 | + isa = "A"; | |
586 | + additional = " [nodiv]"; | |
587 | + break; | |
588 | + case EF_M68K_CF_ISA_A: | |
589 | + isa = "A"; | |
590 | + break; | |
591 | + case EF_M68K_CF_ISA_A_PLUS: | |
592 | + isa = "A+"; | |
593 | + break; | |
594 | + case EF_M68K_CF_ISA_B_NOUSP: | |
595 | + isa = "B"; | |
596 | + additional = " [nousp]"; | |
597 | + break; | |
598 | + case EF_M68K_CF_ISA_B: | |
599 | + isa = "B"; | |
600 | + break; | |
601 | + } | |
602 | + fprintf (file, " [isa %s]%s", isa, additional); | |
603 | + if (eflags & EF_M68K_CF_FLOAT) | |
604 | + fprintf (file, " [float]"); | |
605 | + switch (eflags & EF_M68K_CF_MAC_MASK) | |
606 | + { | |
607 | + case 0: | |
608 | + mac = NULL; | |
609 | + break; | |
610 | + case EF_M68K_CF_MAC: | |
611 | + mac = "mac"; | |
612 | + break; | |
613 | + case EF_M68K_CF_EMAC: | |
614 | + mac = "emac"; | |
615 | + break; | |
616 | + } | |
617 | + if (mac) | |
618 | + fprintf (file, " [%s]", mac); | |
612 | 619 | } |
613 | - if (mac) | |
614 | - fprintf (file, " [%s]", mac); | |
615 | 620 | } |
616 | 621 | |
617 | 622 | fputc ('\n', file); |
@@ -1946,11 +1946,13 @@ get_machine_flags (unsigned e_flags, unsigned e_machine) | ||
1946 | 1946 | break; |
1947 | 1947 | |
1948 | 1948 | case EM_68K: |
1949 | - if (e_flags & EF_M68K_CPU32) | |
1950 | - strcat (buf, ", cpu32"); | |
1951 | - if (e_flags & EF_M68K_M68000) | |
1949 | + if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_M68000) | |
1952 | 1950 | strcat (buf, ", m68000"); |
1953 | - if (e_flags & EF_M68K_CF_ISA_MASK) | |
1951 | + else if ((e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32) | |
1952 | + strcat (buf, ", cpu32"); | |
1953 | + else if (((e_flags & EF_M68K_ARCH_MASK) == 0 | |
1954 | + && (e_flags & EF_M68K_CF_ISA_MASK) != 0) | |
1955 | + || (e_flags & EF_M68K_ARCH_MASK) == EF_M68K_CFV4E) | |
1954 | 1956 | { |
1955 | 1957 | char const *isa = _("unknown"); |
1956 | 1958 | char const *mac = _("unknown mac"); |
@@ -52,12 +52,16 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type) | ||
52 | 52 | RELOC_NUMBER (R_68K_GNU_VTENTRY, 24) |
53 | 53 | END_RELOC_NUMBERS (R_68K_max) |
54 | 54 | |
55 | +/* We use the top 24 bits to encode information about the | |
56 | + architecture variant. */ | |
55 | 57 | #define EF_M68K_CPU32 0x00810000 |
56 | 58 | #define EF_M68K_M68000 0x01000000 |
57 | 59 | #define EF_M68K_CFV4E 0x00008000 |
60 | +#define EF_M68K_ARCH_MASK (EF_M68K_M68000 | EF_M68K_CPU32 | EF_M68K_CFV4E) | |
58 | 61 | |
59 | 62 | /* We use the bottom 8 bits to encode information about the |
60 | - coldfire variant. */ | |
63 | + coldfire variant. If we use any of these bits, the top 24 bits are | |
64 | + either 0 or EF_M68K_CFV4E. */ | |
61 | 65 | #define EF_M68K_CF_ISA_MASK 0x0F /* Which ISA */ |
62 | 66 | #define EF_M68K_CF_ISA_A_NODIV 0x01 /* ISA A except for div */ |
63 | 67 | #define EF_M68K_CF_ISA_A 0x02 |