aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-08-04 11:32:52 +0000
committerNick Clifton <nickc@redhat.com>2003-08-04 11:32:52 +0000
commit8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1 (patch)
tree44aa65ea0c1cab60127661fad7584ac1b0cac7cb /bfd/elflink.h
parent268b6b39310b33c8791ea43e95e81e0bd12d7c8d (diff)
downloadgdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.zip
gdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.gz
gdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.bz2
Prefix .gnu.warning section messages with "warning: ".
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index a2520b1..c0b2468 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,