PR23430, Indices misspelled
[deliverable/binutils-gdb.git] / binutils / readelf.c
index 1b50ba763137149a9d1e83d5e0baaf93f6cf2788..7c5a0266bddf92162b1d915be051926a17fffb67 100644 (file)
@@ -4217,7 +4217,7 @@ get_section_type_name (Filedata * filedata, unsigned int sh_type)
     case SHT_PREINIT_ARRAY:    return "PREINIT_ARRAY";
     case SHT_GNU_HASH:         return "GNU_HASH";
     case SHT_GROUP:            return "GROUP";
-    case SHT_SYMTAB_SHNDX:     return "SYMTAB SECTION INDICIES";
+    case SHT_SYMTAB_SHNDX:     return "SYMTAB SECTION INDICES";
     case SHT_GNU_verdef:       return "VERDEF";
     case SHT_GNU_verneed:      return "VERNEED";
     case SHT_GNU_versym:       return "VERSYM";
@@ -5485,7 +5485,7 @@ get_32bit_elf_symbols (Filedata *           filedata,
          shndx = (Elf_External_Sym_Shndx *) get_data (NULL, filedata,
                                                       entry->hdr->sh_offset,
                                                       1, entry->hdr->sh_size,
-                                                      _("symbol table section indicies"));
+                                                      _("symbol table section indices"));
          if (shndx == NULL)
            goto exit_point;
          /* PR17531: file: heap-buffer-overflow */
@@ -5598,7 +5598,7 @@ get_64bit_elf_symbols (Filedata *           filedata,
          shndx = (Elf_External_Sym_Shndx *) get_data (NULL, filedata,
                                                       entry->hdr->sh_offset,
                                                       1, entry->hdr->sh_size,
-                                                      _("symbol table section indicies"));
+                                                      _("symbol table section indices"));
          if (shndx == NULL)
            goto exit_point;
          /* PR17531: file: heap-buffer-overflow */
@@ -6508,8 +6508,7 @@ process_section_headers (Filedata * filedata)
        }
       else if (do_section_details)
        {
-         printf ("       %-15.15s  ",
-                 get_section_type_name (filedata, section->sh_type));
+         putchar (' ');
          print_vma (section->sh_addr, LONG_HEX);
          if ((long) section->sh_offset == section->sh_offset)
            printf ("  %16.16lx", (unsigned long) section->sh_offset);
@@ -6843,7 +6842,7 @@ process_section_groups (Filedata * filedata)
                      error (_("section [%5u] in group section [%5u] > maximum section [%5u]\n"),
                             entry, i, filedata->file_header.e_shnum - 1);
                      if (num_group_errors == 10)
-                       warn (_("Further error messages about overlarge group section indicies suppressed\n"));
+                       warn (_("Further error messages about overlarge group section indices suppressed\n"));
                    }
                  continue;
                }
@@ -15584,6 +15583,8 @@ print_mips_ases (unsigned int mask)
     fputs ("\n\tCRC ASE", stdout);
   if (mask & AFL_ASE_GINV)
     fputs ("\n\tGINV ASE", stdout);
+  if (mask & AFL_ASE_LOONGSON_MMI)
+    fputs ("\n\tLoongson MMI ASE", stdout);
   if (mask == 0)
     fprintf (stdout, "\n\t%s", _("None"));
   else if ((mask & ~AFL_ASE_MASK) != 0)
@@ -16680,7 +16681,7 @@ get_note_type (Filedata * filedata, unsigned e_type)
       case NT_PPC_TM_CVMX:
        return _("NT_PPC_TM_CVMX (ppc checkpointed Altivec registers)");
       case NT_PPC_TM_CVSX:
-       return _("NT_PPC_TM_VSX (ppc checkpointed VSX registers)");
+       return _("NT_PPC_TM_CVSX (ppc checkpointed VSX registers)");
       case NT_PPC_TM_SPR:
        return _("NT_PPC_TM_SPR (ppc TM special purpose registers)");
       case NT_PPC_TM_CTAR:
@@ -17705,6 +17706,20 @@ get_symbol_for_build_attribute (Filedata *       filedata,
   return saved_sym;
 }
 
+/* Returns true iff addr1 and addr2 are in the same section.  */
+
+static bfd_boolean
+same_section (Filedata * filedata, unsigned long addr1, unsigned long addr2)
+{
+  Elf_Internal_Shdr * a1;
+  Elf_Internal_Shdr * a2;
+
+  a1 = find_section_by_address (filedata, addr1);
+  a2 = find_section_by_address (filedata, addr2);
+  
+  return a1 == a2 && a1 != NULL;
+}
+
 static bfd_boolean
 print_gnu_build_attribute_description (Elf_Internal_Note *  pnote,
                                       Filedata *           filedata)
@@ -17786,8 +17801,14 @@ print_gnu_build_attribute_description (Elf_Internal_Note *  pnote,
 
   if (is_open_attr)
     {
-      /* FIXME: Need to properly allow for section alignment.  16 is just the alignment used on x86_64.  */
-      if (global_end > 0 && start > BFD_ALIGN (global_end, 16))
+      /* FIXME: Need to properly allow for section alignment.
+        16 is just the alignment used on x86_64.  */
+      if (global_end > 0
+         && start > BFD_ALIGN (global_end, 16)
+         /* Build notes are not guaranteed to be organised in order of
+            increasing address, but we should find the all of the notes
+            for one section in the same place.  */
+         && same_section (filedata, start, global_end))
        warn (_("Gap in build notes detected from %#lx to %#lx\n"),
              global_end + 1, start - 1);
 
@@ -19006,7 +19027,7 @@ process_archive (Filedata * filedata, bfd_boolean is_thin_archive)
              l += strnlen (arch.sym_table + l, arch.sym_size - l) + 1;
            }
 
-         if (arch.uses_64bit_indicies)
+         if (arch.uses_64bit_indices)
            l = (l + 7) & ~ 7;
          else
            l += l & 1;
This page took 0.026957 seconds and 4 git commands to generate.