From: Nick Clifton Date: Mon, 4 Aug 2003 11:32:52 +0000 (+0000) Subject: Prefix .gnu.warning section messages with "warning: ". X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1;p=binutils-gdb.git Prefix .gnu.warning section messages with "warning: ". --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b2686ef969d..8645db01043 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-08-04 Nick Clifton + + * elflink.h (elf_link_add_object_symbols): Prepend "warning: " + to messages produced for .gnu.warning.SYMBOL sections. + 2003-08-04 Alan Modra * elfcode.h: Convert to C90, remove unneeded casts and prototypes. diff --git a/bfd/elflink.h b/bfd/elflink.h index a2520b1d808..c0b2468b7d8 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -459,6 +459,8 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) { char *msg; bfd_size_type sz; + bfd_size_type prefix_len; + const char * gnu_warning_prefix = _("warning: "); name += sizeof ".gnu.warning." - 1; @@ -492,14 +494,16 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) } sz = bfd_section_size (abfd, s); - msg = bfd_alloc (abfd, sz + 1); + prefix_len = strlen (gnu_warning_prefix); + msg = bfd_alloc (abfd, prefix_len + sz + 1); if (msg == NULL) goto error_return; - if (! bfd_get_section_contents (abfd, s, msg, 0, sz)) + strcpy (msg, gnu_warning_prefix); + if (! bfd_get_section_contents (abfd, s, msg + prefix_len, 0, sz)) goto error_return; - msg[sz] = '\0'; + msg[prefix_len + sz] = '\0'; if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, BSF_WARNING, s, 0, msg, diff --git a/ld/ChangeLog b/ld/ChangeLog index 326d3b01db2..68e92d63054 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2003-08-04 Nick Clifton + + * emultempl/elf32.em (before_allocation): Prepend "warning: " + to messages produced for .gnu.warning.SYMBOL sections. + 2003-08-04 Alan Modra * emultempl/elf32.em (output_rel_find): Add "isdyn" param. Put diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index e5fefa977f2..dfe4e2d3087 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,