aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@avtrex.com>2011-12-07 03:50:10 +0000
committerDavid Daney <ddaney@avtrex.com>2011-12-07 03:50:10 +0000
commit4b68bca3c10bcfb6ce2a1e877e1b9a18311b3a61 (patch)
tree311705f9743a04bc4fca8256d0de427caf06f4dd /binutils/readelf.c
parent5436df9582123e5b169ef0b5fcc338d4ee00cc35 (diff)
downloadgdb-4b68bca3c10bcfb6ce2a1e877e1b9a18311b3a61.zip
gdb-4b68bca3c10bcfb6ce2a1e877e1b9a18311b3a61.tar.gz
gdb-4b68bca3c10bcfb6ce2a1e877e1b9a18311b3a61.tar.bz2
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.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 0710b2c..70cf852 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -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