aboutsummaryrefslogtreecommitdiff
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
parent268b6b39310b33c8791ea43e95e81e0bd12d7c8d (diff)
downloadgdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.zip
gdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.gz
gdb-8c6756949e8e0c195dbe99b1a9bdd54899a0f8d1.tar.bz2
Prefix .gnu.warning section messages with "warning: ".
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h10
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf32.em11
4 files changed, 25 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b2686ef..8645db0 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 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,
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,