]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* readelf.c (get_machine_flags): Recognize header flags for ABI and
authorThiemo Seufer <ths@networkno.de>
Tue, 18 Dec 2001 15:08:05 +0000 (15:08 +0000)
committerThiemo Seufer <ths@networkno.de>
Tue, 18 Dec 2001 15:08:05 +0000 (15:08 +0000)
ASE extensions. More robust code for ISA checking. Ignore empty fields
in header flags for GNU extensions.

binutils/ChangeLog
binutils/readelf.c

index 440ae5b98aaa3d7925ae621856e18260c2bceec5..630202f16922bef11a8b70b8e39d89ceedbc93ee 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-18  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+
+       * readelf.c (get_machine_flags): Recognize header flags for ABI and
+       ASE extensions. More robust code for ISA checking. Ignore empty fields
+       in header flags for GNU extensions.
+
 2001-12-18  Alan Modra  <amodra@bigpond.net.au>
 
        * objcopy.c (copy_archive): Set output bfd format outside the loop.
index cd97886a4fd6202552ea02332ea6d9d4248b2832..35907f9f5c0d2a8704c9fd09d42a1f5497d2714d 100644 (file)
@@ -1647,30 +1647,12 @@ get_machine_flags (e_flags, e_machine)
          if (e_flags & EF_MIPS_ABI2)
            strcat (buf, ", abi2");
 
+         if (e_flags & EF_MIPS_OPTIONS_FIRST)
+           strcat (buf, ", odk first");
+
          if (e_flags & EF_MIPS_32BITMODE)
            strcat (buf, ", 32bitmode");
 
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_1)
-           strcat (buf, ", mips1");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2)
-           strcat (buf, ", mips2");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_3)
-           strcat (buf, ", mips3");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)
-           strcat (buf, ", mips4");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5)
-           strcat (buf, ", mips5");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32)
-           strcat (buf, ", mips32");
-
-         if ((e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64)
-           strcat (buf, ", mips64");
-
          switch ((e_flags & EF_MIPS_MACH))
            {
            case E_MIPS_MACH_3900: strcat (buf, ", 3900"); break;
@@ -1679,8 +1661,47 @@ get_machine_flags (e_flags, e_machine)
            case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break;
            case E_MIPS_MACH_4111: strcat (buf, ", 4111"); break;
            case E_MIPS_MACH_SB1:  strcat (buf, ", sb1");  break;
-           default: strcat (buf, " UNKNOWN"); break;
+           case 0:
+           /* We simply ignore the field in this case to avoid confusion:
+              MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
+              extension.  */
+             break;
+           default: strcat (buf, ", unknown CPU"); break;
            }
+
+         switch ((e_flags & EF_MIPS_ABI))
+           {
+           case E_MIPS_ABI_O32: strcat (buf, ", o32"); break;
+           case E_MIPS_ABI_O64: strcat (buf, ", o64"); break;
+           case E_MIPS_ABI_EABI32: strcat (buf, ", eabi32"); break;
+           case E_MIPS_ABI_EABI64: strcat (buf, ", eabi64"); break;
+           case 0:
+           /* We simply ignore the field in this case to avoid confusion:
+              MIPS ELF does not specify EF_MIPS_ABI, it is a GNU extension.
+              This means it is likely to be an o32 file, but not for
+              sure.  */
+             break;
+           default: strcat (buf, ", unknown ABI"); break;
+           }
+
+         if (e_flags & EF_MIPS_ARCH_ASE_MDMX)
+           strcat (buf, ", mdmx");
+
+         if (e_flags & EF_MIPS_ARCH_ASE_M16)
+           strcat (buf, ", mips16");
+
+         switch ((e_flags & EF_MIPS_ARCH))
+           {
+           case E_MIPS_ARCH_1: strcat (buf, ", mips1"); break;
+           case E_MIPS_ARCH_2: strcat (buf, ", mips2"); break;
+           case E_MIPS_ARCH_3: strcat (buf, ", mips3"); break;
+           case E_MIPS_ARCH_4: strcat (buf, ", mips4"); break;
+           case E_MIPS_ARCH_5: strcat (buf, ", mips5"); break;
+           case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break;
+           case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break;
+           default: strcat (buf, ", unknown ISA"); break;
+           }
+
          break;
 
        case EM_SPARCV9: