]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2011-12-06 David Daney <david.daney@cavium.com>
authorDavid Daney <ddaney@avtrex.com>
Wed, 7 Dec 2011 03:50:10 +0000 (03:50 +0000)
committerDavid Daney <ddaney@avtrex.com>
Wed, 7 Dec 2011 03:50:10 +0000 (03:50 +0000)
* readelf.c (dynamic_section_mips_val): Factor out trailing '\n'
from printed strings and move it to the end of the function.
Use BFD_VMA_FMT for printf format specifier for dynamic tag value.
Use print_vma() to print dynamic tag values.

binutils/ChangeLog
binutils/readelf.c

index 4afafa8b2242f22edf0a99f8b193f9a5f2f875c2..56f2b8b50cff61629397eb357612d213d360f228 100644 (file)
@@ -1,3 +1,10 @@
+2011-12-06 David Daney <david.daney@cavium.com>
+
+       * readelf.c (dynamic_section_mips_val): Factor out trailing '\n'
+       from printed strings and move it to the end of the function.
+       Use BFD_VMA_FMT for printf format specifier for dynamic tag value.
+       Use print_vma() to print dynamic tag values.
+
 2011-12-02  Nick Clifton  <nickc@redhat.com>
 
        * readelf.c (ia64_process_unwind): Turn into a void funtion.
index 0710b2c8d1950e46f163d30d99721c3890117296..70cf8522a61b7d4c0e96bb525f07c33e976b7d8b 100644 (file)
@@ -7234,7 +7234,7 @@ dynamic_section_mips_val (Elf_Internal_Dyn * entry)
     {
     case DT_MIPS_FLAGS:
       if (entry->d_un.d_val == 0)
-       printf (_("NONE\n"));
+       printf (_("NONE"));
       else
        {
          static const char * opts[] =
@@ -7254,15 +7254,14 @@ dynamic_section_mips_val (Elf_Internal_Dyn * entry)
                printf ("%s%s", first ? "" : " ", opts[cnt]);
                first = 0;
              }
-         puts ("");
        }
       break;
 
     case DT_MIPS_IVERSION:
       if (VALID_DYNAMIC_NAME (entry->d_un.d_val))
-       printf (_("Interface Version: %s\n"), GET_DYNAMIC_NAME (entry->d_un.d_val));
+       printf (_("Interface Version: %s"), GET_DYNAMIC_NAME (entry->d_un.d_val));
       else
-       printf (_("<corrupt: %ld>\n"), (long) entry->d_un.d_ptr);
+       printf (_("<corrupt: %" BFD_VMA_FMT "d>"), entry->d_un.d_ptr);
       break;
 
     case DT_MIPS_TIME_STAMP:
@@ -7275,7 +7274,7 @@ dynamic_section_mips_val (Elf_Internal_Dyn * entry)
        snprintf (timebuf, sizeof (timebuf), "%04u-%02u-%02uT%02u:%02u:%02u",
                  tmp->tm_year + 1900, tmp->tm_mon + 1, tmp->tm_mday,
                  tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
-       printf (_("Time Stamp: %s\n"), timebuf);
+       printf (_("Time Stamp: %s"), timebuf);
       }
       break;
 
@@ -7292,12 +7291,13 @@ dynamic_section_mips_val (Elf_Internal_Dyn * entry)
     case DT_MIPS_DELTA_SYM_NO:
     case DT_MIPS_DELTA_CLASSSYM_NO:
     case DT_MIPS_COMPACT_SIZE:
-      printf ("%ld\n", (long) entry->d_un.d_ptr);
+      print_vma (entry->d_un.d_ptr, DEC);
       break;
 
     default:
-      printf ("%#lx\n", (unsigned long) entry->d_un.d_ptr);
+      print_vma (entry->d_un.d_ptr, PREFIX_HEX);
     }
+    putchar ('\n');
 }
 
 static void