From 4b68bca3c10bcfb6ce2a1e877e1b9a18311b3a61 Mon Sep 17 00:00:00 2001 From: David Daney Date: Wed, 7 Dec 2011 03:50:10 +0000 Subject: [PATCH] 2011-12-06 David Daney * 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 | 7 +++++++ binutils/readelf.c | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 4afafa8b224..56f2b8b50cf 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2011-12-06 David Daney + + * 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 * readelf.c (ia64_process_unwind): Turn into a void funtion. diff --git a/binutils/readelf.c b/binutils/readelf.c index 0710b2c8d19..70cf8522a61 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 (_("\n"), (long) entry->d_un.d_ptr); + printf (_(""), 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 -- 2.30.2