Updated translation
[deliverable/binutils-gdb.git] / binutils / readelf.c
index b3d36234faf444de781b08bec531f26256946818..00a6d330fe7f7c45719c7c0dc0203c65b9cb0fee 100644 (file)
@@ -79,6 +79,7 @@
 #include "elf/or32.h"
 #include "elf/pj.h"
 #include "elf/ppc.h"
+#include "elf/ppc64.h"
 #include "elf/s390.h"
 #include "elf/sh.h"
 #include "elf/sparc.h"
@@ -86,6 +87,7 @@
 #include "elf/vax.h"
 #include "elf/x86-64.h"
 #include "elf/xstormy16.h"
+#include "elf/iq2000.h"
 
 #include "bucomm.h"
 #include "getopt.h"
@@ -177,6 +179,8 @@ static const char *get_ppc64_dynamic_type
   PARAMS ((unsigned long));
 static const char *get_parisc_dynamic_type
   PARAMS ((unsigned long));
+static const char *get_ia64_dynamic_type
+  PARAMS ((unsigned long));
 static const char *get_dynamic_type
   PARAMS ((unsigned long));
 static int slurp_rela_relocs
@@ -238,6 +242,8 @@ static void dynamic_segment_mips_val
   PARAMS ((Elf_Internal_Dyn *));
 static void dynamic_segment_parisc_val
   PARAMS ((Elf_Internal_Dyn *));
+static void dynamic_segment_ia64_val
+  PARAMS ((Elf_Internal_Dyn *));
 static int process_dynamic_segment
   PARAMS ((FILE *));
 static int process_symbol_table
@@ -763,6 +769,7 @@ guess_is_rela (e_machine)
     case EM_VAX:
     case EM_IP2K:
     case EM_IP2K_OLD:
+    case EM_IQ2000:
       return TRUE;
 
     case EM_MMA:
@@ -1022,8 +1029,22 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
        }
       else
        {
+         /* The #ifdef BFD64 below is to prevent a compile time warning.
+            We know that if we do not have a 64 bit data type that we
+            will never execute this code anyway.  */
+#ifdef BFD64
          if (elf_header.e_machine == EM_MIPS)
            {
+             /* In little-endian objects, r_info isn't really a 64-bit
+                little-endian value: it has a 32-bit little-endian
+                symbol index followed by four individual byte fields.
+                Reorder INFO accordingly.  */
+             if (elf_header.e_ident[EI_DATA] != ELFDATA2MSB)
+               info = (((info & 0xffffffff) << 32)
+                       | ((info >> 56) & 0xff)
+                       | ((info >> 40) & 0xff00)
+                       | ((info >> 24) & 0xff0000)
+                       | ((info >> 8) & 0xff000000));
              type  = ELF64_MIPS_R_TYPE (info);
              type2 = ELF64_MIPS_R_TYPE2 (info);
              type3 = ELF64_MIPS_R_TYPE3 (info);
@@ -1032,10 +1053,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
            type = ELF64_R_TYPE_ID (info);
          else
            type = ELF64_R_TYPE (info);
-         /* The #ifdef BFD64 below is to prevent a compile time warning.
-            We know that if we do not have a 64 bit data type that we
-            will never execute this code anyway.  */
-#ifdef BFD64
+
          symtab_index = ELF64_R_SYM  (info);
 #endif
        }
@@ -1163,10 +1181,13 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
          break;
 
        case EM_PPC:
-       case EM_PPC64:
          rtype = elf_ppc_reloc_type (type);
          break;
 
+       case EM_PPC64:
+         rtype = elf_ppc64_reloc_type (type);
+         break;
+
        case EM_MIPS:
        case EM_MIPS_RS3_LE:
          rtype = elf_mips_reloc_type (type);
@@ -1245,6 +1266,10 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela)
        case EM_IP2K_OLD:
          rtype = elf_ip2k_reloc_type (type);
          break;
+
+       case EM_IQ2000:
+         rtype = elf_iq2000_reloc_type (type);
+         break;
        }
 
       if (rtype == NULL)
@@ -1458,6 +1483,18 @@ get_parisc_dynamic_type (type)
     }
 }
 
+static const char *
+get_ia64_dynamic_type (type)
+     unsigned long type;
+{
+  switch (type)
+    {
+    case DT_IA_64_PLT_RESERVE: return "IA_64_PLT_RESERVE";
+    default:
+      return NULL;
+    }
+}
+
 static const char *
 get_dynamic_type (type)
      unsigned long type;
@@ -1555,6 +1592,9 @@ get_dynamic_type (type)
            case EM_PPC64:
              result = get_ppc64_dynamic_type (type);
              break;
+           case EM_IA_64:
+             result = get_ia64_dynamic_type (type);
+             break;
            default:
              result = NULL;
              break;
@@ -1704,7 +1744,7 @@ get_machine_name (e_machine)
     case EM_ZSP:               return "LSI Logic's 16-bit DSP processor";
     case EM_MMIX:              return "Donald Knuth's educational 64-bit processor";
     case EM_HUANY:             return "Harvard Universitys's machine-independent object format";
-    case EM_PRISM:             return "SiTera Prism";
+    case EM_PRISM:             return "Vitesse Prism";
     case EM_X86_64:            return "Advanced Micro Devices X86-64";
     case EM_S390_OLD:
     case EM_S390:              return "IBM S/390";
@@ -1714,6 +1754,7 @@ get_machine_name (e_machine)
     case EM_DLX:               return "OpenDLX";
     case EM_IP2K_OLD:
     case EM_IP2K:              return "Ubicom IP2xxx 8-bit microcontrollers";
+    case EM_IQ2000:            return "Vitesse IQ2000";
     default:
       sprintf (buff, _("<unknown>: %x"), e_machine);
       return buff;
@@ -1851,6 +1892,10 @@ decode_ARM_machine_flags (e_flags, buf)
              strcat (buf, ", software FP");
              break;
 
+           case EF_ARM_MAVERICK_FLOAT:
+             strcat (buf, ", Maverick FP");
+             break;
+
            default:
              unknown = 1;
              break;
@@ -2305,10 +2350,15 @@ static const char *
 get_ia64_section_type_name (sh_type)
      unsigned int sh_type;
 {
+  /* If the top 8 bits are 0x78 the next 8 are the os/abi ID. */
+  if ((sh_type & 0xFF000000) == SHT_IA_64_LOPSREG)
+    return get_osabi_name ((sh_type & 0x00FF0000) >> 16);
+      
   switch (sh_type)
     {
-    case SHT_IA_64_EXT:                return "IA_64_EXT";
-    case SHT_IA_64_UNWIND:     return "IA_64_UNWIND";
+    case SHT_IA_64_EXT:                  return "IA_64_EXT";
+    case SHT_IA_64_UNWIND:       return "IA_64_UNWIND";
+    case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT";
     default:
       break;
     }
@@ -2503,7 +2553,7 @@ parse_args (argc, argv)
     usage ();
 
   while ((c = getopt_long
-         (argc, argv, "ersuahnldSDAIw::x:i:vVW", options, NULL)) != EOF)
+         (argc, argv, "ersuahnldSDAIw::x:i:vVWH", options, NULL)) != EOF)
     {
       char *cp;
       int section;
@@ -2819,6 +2869,9 @@ get_osabi_name (osabi)
     case ELFOSABI_TRU64:       return "UNIX - TRU64";
     case ELFOSABI_MODESTO:     return "Novell - Modesto";
     case ELFOSABI_OPENBSD:     return "UNIX - OpenBSD";
+    case ELFOSABI_OPENVMS:     return "VMS - OpenVMS";
+    case ELFOSABI_NSK:         return "HP - Non-Stop Kernel";
+    case ELFOSABI_AROS:                return "Amiga Research OS";
     case ELFOSABI_STANDALONE:  return _("Standalone App");
     case ELFOSABI_ARM:         return "ARM";
     default:
@@ -4443,6 +4496,21 @@ dynamic_segment_parisc_val (entry)
   putchar ('\n');
 }
 
+static void
+dynamic_segment_ia64_val (entry)
+     Elf_Internal_Dyn *entry;
+{
+  switch (entry->d_tag)
+    {
+    case DT_IA_64_PLT_RESERVE: 
+      /* First 3 bytes reserved.  */
+      print_vma (entry->d_un.d_ptr, PREFIX_HEX);
+      printf (" -- ");
+      print_vma (entry->d_un.d_ptr + (3 * 8), PREFIX_HEX);
+      printf ("\n");
+    }
+}
+
 static int
 get_32bit_dynamic_segment (file)
      FILE *file;
@@ -5092,6 +5160,9 @@ process_dynamic_segment (file)
                case EM_PARISC:
                  dynamic_segment_parisc_val (entry);
                  break;
+               case EM_IA_64:
+                 dynamic_segment_ia64_val (entry);
+                 break;
                default:
                  print_vma (entry->d_un.d_val, PREFIX_HEX);
                  putchar ('\n');
@@ -7614,13 +7685,12 @@ display_debug_loc (section, start, file)
 
       while (1)
        {
-         /* Normally, the lists in  the debug_loc section are related to a
-            given compilation unit, and thus, we would use the
-            pointer size of that compilation unit.  However, since we are
-            displaying it seperately here, we either have to store
-            pointer sizes of all compilation units, or assume they don't
-            change.   We assume, like the debug_line display, that
-            it doesn't change.  */
+         /* Normally, the lists in the debug_loc section are related to a
+            given compilation unit, and thus, we would use the pointer size
+            of that compilation unit.  However, since we are displaying it
+            seperately here, we either have to store pointer sizes of all
+            compilation units, or assume they don't change.   We assume,
+            like the debug_line display, that it doesn't change.  */
          begin = byte_get (start, debug_line_pointer_size);
          start += debug_line_pointer_size;
          end = byte_get (start, debug_line_pointer_size);
@@ -7629,6 +7699,10 @@ display_debug_loc (section, start, file)
          if (begin == 0 && end == 0)
            break;
 
+         /* For now, skip any base address specifiers.  */
+         if (begin == 0xffffffff)
+           continue;
+
          begin += addr;
          end += addr;
 
This page took 0.027292 seconds and 4 git commands to generate.