From ada487f6b3f8fdc448569d8cdc80f3279787ec29 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 6 Dec 2010 20:59:20 +0000 Subject: [PATCH] Remove the trailing `\n' from TV_MESSAGE. 2010-12-06 H.J. Lu PR ld/12288 * testplug.c: Remove the trailing `\n' from TV_MESSAGE. --- ld/ChangeLog | 5 +++++ ld/testplug.c | 45 +++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index e4140e6acf9..19f4c624dde 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2010-12-06 H.J. Lu + + PR ld/12288 + * testplug.c: Remove the trailing `\n' from TV_MESSAGE. + 2010-12-06 Dmitry Gorbachev PR ld/12288 diff --git a/ld/testplug.c b/ld/testplug.c index ee3652b3083..f04df10fa05 100644 --- a/ld/testplug.c +++ b/ld/testplug.c @@ -349,12 +349,12 @@ dump_tv_tag (size_t n, struct ld_plugin_tv *tv) break; sprintf (unknownbuf, "unknown tag #%d", tv->tv_tag); name = (tag < ARRAY_SIZE (tag_names)) ? tag_names[tag].name : unknownbuf; - TV_MESSAGE (LDPL_INFO, "tv[%d]: %s ", n, name); switch (tv->tv_tag) { case LDPT_OPTION: case LDPT_OUTPUT_NAME: - TV_MESSAGE (LDPL_INFO, "'%s'\n", tv->tv_u.tv_string); + TV_MESSAGE (LDPL_INFO, "tv[%d]: %s '%s'", n, name, + tv->tv_u.tv_string); break; case LDPT_REGISTER_CLAIM_FILE_HOOK: case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK: @@ -367,8 +367,8 @@ dump_tv_tag (size_t n, struct ld_plugin_tv *tv) case LDPT_RELEASE_INPUT_FILE: case LDPT_ADD_INPUT_LIBRARY: case LDPT_SET_EXTRA_LIBRARY_PATH: - TV_MESSAGE (LDPL_INFO, "func@0x%p\n", - (void *)(tv->tv_u.tv_message)); + TV_MESSAGE (LDPL_INFO, "tv[%d]: %s func@0x%p", n, name, + (void *)(tv->tv_u.tv_message)); break; case LDPT_NULL: case LDPT_API_VERSION: @@ -376,8 +376,8 @@ dump_tv_tag (size_t n, struct ld_plugin_tv *tv) case LDPT_LINKER_OUTPUT: case LDPT_GNU_LD_VERSION: default: - TV_MESSAGE (LDPL_INFO, "value %W (%d)\n", - (bfd_vma)tv->tv_u.tv_val, tv->tv_u.tv_val); + TV_MESSAGE (LDPL_INFO, "tv[%d]: %s value %W (%d)", n, name, + (bfd_vma)tv->tv_u.tv_val, tv->tv_u.tv_val); break; } } @@ -469,21 +469,19 @@ onload (struct ld_plugin_tv *tv) tv_message = tv[0].tv_u.tv_message; fflush (NULL); - TV_MESSAGE (LDPL_INFO, "Hello from testplugin.\n"); + TV_MESSAGE (LDPL_INFO, "Hello from testplugin."); do if ((rv = parse_and_dump_tv_tag (n++, tv)) != LDPS_OK) return rv; while ((tv++)->tv_tag != LDPT_NULL); - TV_MESSAGE (LDPL_INFO, "\n"); - /* Register hooks only if instructed by options. */ if (register_claimfile_hook) { if (!tv_register_claim_file) { - TV_MESSAGE (LDPL_FATAL, "No register_claim_file hook\n"); + TV_MESSAGE (LDPL_FATAL, "No register_claim_file hook"); fflush (NULL); return LDPS_ERR; } @@ -493,7 +491,7 @@ onload (struct ld_plugin_tv *tv) { if (!tv_register_all_symbols_read) { - TV_MESSAGE (LDPL_FATAL, "No register_all_symbols_read hook\n"); + TV_MESSAGE (LDPL_FATAL, "No register_all_symbols_read hook"); fflush (NULL); return LDPS_ERR; } @@ -503,7 +501,7 @@ onload (struct ld_plugin_tv *tv) { if (!tv_register_cleanup) { - TV_MESSAGE (LDPL_FATAL, "No register_cleanup hook\n"); + TV_MESSAGE (LDPL_FATAL, "No register_cleanup hook"); fflush (NULL); return LDPS_ERR; } @@ -527,9 +525,9 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed) } /* Inform the user/testsuite. */ - TV_MESSAGE (LDPL_INFO, "hook called: claim_file %s [@%ld/%ld] %s\n", - file->name, (long)file->offset, (long)file->filesize, - claimfile ? "CLAIMED" : "not claimed"); + TV_MESSAGE (LDPL_INFO, "hook called: claim_file %s [@%ld/%ld] %s", + file->name, (long)file->offset, (long)file->filesize, + claimfile ? "CLAIMED" : "not claimed"); fflush (NULL); /* If we decided to claim it, record that fact, and add any symbols @@ -567,7 +565,7 @@ onall_symbols_read (void) }; claim_file_t *claimfile = dumpresolutions ? claimfiles_list : NULL; add_file_t *addfile = addfiles_list; - TV_MESSAGE (LDPL_INFO, "hook called: all symbols read.\n"); + TV_MESSAGE (LDPL_INFO, "hook called: all symbols read."); for ( ; claimfile; claimfile = claimfile->next) { enum ld_plugin_status rv; @@ -581,12 +579,12 @@ onall_symbols_read (void) if (rv != LDPS_OK) return rv; for (n = 0; n < claimfile->n_syms_used; n++) - TV_MESSAGE (LDPL_INFO, "Sym: '%s%s%s' Resolution: %s\n", - claimfile->symbols[n].name, - claimfile->symbols[n].version ? "@" : "", - claimfile->symbols[n].version ? claimfile->symbols[n].version - : "", - resolutions[claimfile->symbols[n].resolution]); + TV_MESSAGE (LDPL_INFO, "Sym: '%s%s%s' Resolution: %s", + claimfile->symbols[n].name, + claimfile->symbols[n].version ? "@" : "", + (claimfile->symbols[n].version + ? claimfile->symbols[n].version : ""), + resolutions[claimfile->symbols[n].resolution]); } for ( ; addfile ; addfile = addfile->next) { @@ -610,8 +608,7 @@ onall_symbols_read (void) static enum ld_plugin_status oncleanup (void) { - TV_MESSAGE (LDPL_INFO, "hook called: cleanup.\n"); + TV_MESSAGE (LDPL_INFO, "hook called: cleanup."); fflush (NULL); return cleanup_ret; } - -- 2.30.2