From 8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 4 Aug 2003 11:32:52 +0000 Subject: Prefix .gnu.warning section messages with "warning: ". --- ld/emultempl/elf32.em | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'ld/emultempl') diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index e5fefa9..dfe4e2d 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -880,8 +880,10 @@ ${ELF_INTERPRETER_SET_DEFAULT} { asection *s; bfd_size_type sz; + bfd_size_type prefix_len; char *msg; bfd_boolean ret; + const char * gnu_warning_prefix = _("warning: "); if (is->just_syms_flag) continue; @@ -891,11 +893,14 @@ ${ELF_INTERPRETER_SET_DEFAULT} continue; sz = bfd_section_size (is->the_bfd, s); - msg = xmalloc ((size_t) sz + 1); - if (! bfd_get_section_contents (is->the_bfd, s, msg, (file_ptr) 0, sz)) + prefix_len = strlen (gnu_warning_prefix); + msg = xmalloc ((size_t) (prefix_len + sz + 1)); + strcpy (msg, gnu_warning_prefix); + if (! bfd_get_section_contents (is->the_bfd, s, msg + prefix_len, + (file_ptr) 0, sz)) einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n", is->the_bfd); - msg[sz] = '\0'; + msg[prefix_len + sz] = '\0'; ret = link_info.callbacks->warning (&link_info, msg, (const char *) NULL, is->the_bfd, (asection *) NULL, -- cgit v1.1