summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-08-04 11:32:51 +0000
committerNick Clifton <nickc@redhat.com>2003-08-04 11:32:51 +0000
commit942f0a5286ceadf5db7322d417810a9b571fbba2 (patch)
tree02a0510f43644840a86be9190873cedfed0103e6 /bfd
parent1bfa2c4f670f3f1793e5e092fde3cc880dd3c100 (diff)
downloadgdb-942f0a5286ceadf5db7322d417810a9b571fbba2.tar.gz
Prefix .gnu.warning section messages with "warning: ".
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h10
2 files changed, 12 insertions, 3 deletions
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 <nickc@redhat.com>
+
+ * elflink.h (elf_link_add_object_symbols): Prepend "warning: "
+ to messages produced for .gnu.warning.SYMBOL sections.
+
2003-08-04 Alan Modra <amodra@bigpond.net.au>
* 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,