• 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

Revision8880056ce04c7d4c8a0d54e51dda8bd751c55304 (tree)
Time2006-11-28 23:09:50
AuthorKazu Hirata <kazu@code...>
CommiterKazu Hirata

Log Message

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.

Change Summary

Incremental Difference

--- a/ChangeLog.csl
+++ b/ChangeLog.csl
@@ -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+
115 2006-11-19 Nathan Sidwell <nathan@codesourcery.com>
216
317 opcodes/
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -441,11 +441,13 @@ elf32_m68k_object_p (bfd *abfd)
441441 unsigned features = 0;
442442 flagword eflags = elf_elfheader (abfd)->e_flags;
443443
444- if (eflags & EF_M68K_M68000)
444+ if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_M68000)
445445 features |= m68000;
446- else if (eflags & EF_M68K_CPU32)
446+ else if ((eflags & EF_M68K_ARCH_MASK) == EF_M68K_CPU32)
447447 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)
449451 {
450452 switch (eflags & EF_M68K_CF_ISA_MASK)
451453 {
@@ -560,58 +562,61 @@ elf32_m68k_print_private_bfd_data (abfd, ptr)
560562 /* xgettext:c-format */
561563 fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags);
562564
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)
567566 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)
573572 {
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)
602577 {
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);
612619 }
613- if (mac)
614- fprintf (file, " [%s]", mac);
615620 }
616621
617622 fputc ('\n', file);
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -1946,11 +1946,13 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
19461946 break;
19471947
19481948 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)
19521950 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)
19541956 {
19551957 char const *isa = _("unknown");
19561958 char const *mac = _("unknown mac");
--- a/include/elf/m68k.h
+++ b/include/elf/m68k.h
@@ -52,12 +52,16 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type)
5252 RELOC_NUMBER (R_68K_GNU_VTENTRY, 24)
5353 END_RELOC_NUMBERS (R_68K_max)
5454
55+/* We use the top 24 bits to encode information about the
56+ architecture variant. */
5557 #define EF_M68K_CPU32 0x00810000
5658 #define EF_M68K_M68000 0x01000000
5759 #define EF_M68K_CFV4E 0x00008000
60+#define EF_M68K_ARCH_MASK (EF_M68K_M68000 | EF_M68K_CPU32 | EF_M68K_CFV4E)
5861
5962 /* 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. */
6165 #define EF_M68K_CF_ISA_MASK 0x0F /* Which ISA */
6266 #define EF_M68K_CF_ISA_A_NODIV 0x01 /* ISA A except for div */
6367 #define EF_M68K_CF_ISA_A 0x02