aboutsummaryrefslogtreecommitdiff
path: root/ld
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 /ld
parent268b6b39310b33c8791ea43e95e81e0bd12d7c8d (diff)
downloadbinutils-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.zip
binutils-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.gz
binutils-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.bz2
Prefix .gnu.warning section messages with "warning: ".
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf32.em11
2 files changed, 13 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 326d3b0..68e92d6 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-04 Nick Clifton <nickc@redhat.com>
+
+ * emultempl/elf32.em (before_allocation): Prepend "warning: "
+ to messages produced for .gnu.warning.SYMBOL sections.
+
2003-08-04 Alan Modra <amodra@bigpond.net.au>
* emultempl/elf32.em (output_rel_find): Add "isdyn" param. Put
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,