* config/tc-mips.c (mips_set_options): Add ase_mt for MT instructions.
[deliverable/binutils-gdb.git] / binutils / objdump.c
index 52cd3d005cc051ffd1e2a53156dcea60f1955a56..14c9cb6888a490873229ec422a19ab01c10bc64b 100644 (file)
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 /* Objdump overview.
 
@@ -65,7 +65,7 @@
 #define        BYTES_IN_WORD   32
 #include "aout/aout64.h"
 
-#ifdef NEED_DECLARATION_FPRINTF
+#if !HAVE_DECL_FPRINTF
 /* This is needed by init_disassemble_info().  */
 extern int fprintf (FILE *, const char *, ...);
 #endif
@@ -1189,7 +1189,7 @@ typedef struct
 
 /* sprintf to a "stream".  */
 
-static int
+static int ATTRIBUTE_PRINTF_2
 objdump_sprintf (SFILE *f, const char *format, ...)
 {
   size_t n;
@@ -1354,10 +1354,7 @@ disassemble_bytes (struct disassemble_info * info,
          done_dot = FALSE;
 
          if (with_line_numbers || with_source_code)
-           /* The line number tables will refer to unadjusted
-              section VMAs, so we must undo any VMA modifications
-              when calling show_line.  */
-           show_line (aux->abfd, section, addr_offset - adjust_section_vma);
+           show_line (aux->abfd, section, addr_offset);
 
          if (! prefix_addresses)
            {
@@ -1570,7 +1567,12 @@ disassemble_bytes (struct disassemble_info * info,
              objdump_print_value (section->vma - rel_offset + q->address,
                                   info, TRUE);
 
-             printf (": %s\t", q->howto->name);
+             if (q->howto == NULL)
+               printf (": *unknown*\t");
+             else if (q->howto->name)
+               printf (": %s\t", q->howto->name);
+             else
+               printf (": %d\t", q->howto->type);
 
              if (q->sym_ptr_ptr == NULL || *q->sym_ptr_ptr == NULL)
                printf ("*unknown*");
@@ -2465,23 +2467,20 @@ dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
          section_name = NULL;
        }
 
+      bfd_printf_vma (abfd, q->address);
+      if (q->howto == NULL)
+       printf (" *unknown*         ");
+      else if (q->howto->name)
+       printf (" %-16s  ", q->howto->name);
+      else
+       printf (" %-16d  ", q->howto->type);
       if (sym_name)
-       {
-         bfd_printf_vma (abfd, q->address);
-         if (q->howto->name)
-           printf (" %-16s  ", q->howto->name);
-         else
-           printf (" %-16d  ", q->howto->type);
-         objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr);
-       }
+       objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr);
       else
        {
          if (section_name == NULL)
            section_name = "*unknown*";
-         bfd_printf_vma (abfd, q->address);
-         printf (" %-16s  [%s]",
-                 q->howto->name,
-                 section_name);
+         printf ("[%s]", section_name);
        }
 
       if (q->addend)
@@ -2598,10 +2597,15 @@ add_include_path (const char *path)
 static void
 adjust_addresses (bfd *abfd ATTRIBUTE_UNUSED,
                  asection *section,
-                 void *dummy ATTRIBUTE_UNUSED)
+                 void *arg)
 {
-  section->vma += adjust_section_vma;
-  section->lma += adjust_section_vma;
+  if ((section->flags & SEC_DEBUGGING) == 0)
+    {
+      bfd_boolean *has_reloc_p = (bfd_boolean *) arg;
+      section->vma += adjust_section_vma;
+      if (*has_reloc_p)
+       section->lma += adjust_section_vma;
+    }
 }
 
 /* Dump selected contents of ABFD.  */
@@ -2613,7 +2617,10 @@ dump_bfd (bfd *abfd)
      the BFD information is a hack.  However, we must do it, or
      bfd_find_nearest_line will not do the right thing.  */
   if (adjust_section_vma != 0)
-    bfd_map_over_sections (abfd, adjust_addresses, NULL);
+    {
+      bfd_boolean has_reloc = (abfd->flags & HAS_RELOC);
+      bfd_map_over_sections (abfd, adjust_addresses, &has_reloc);
+    }
 
   if (! dump_debugging_tags)
     printf (_("\n%s:     file format %s\n"), bfd_get_filename (abfd),
This page took 0.024496 seconds and 4 git commands to generate.