aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2006-11-06 10:39:17 +0000
committerVladimir Prus <vladimir@codesourcery.com>2006-11-06 10:39:17 +0000
commitbc251d509b711b2db0a1aa269c432d23be019f84 (patch)
tree06fe8b2bf5a956b0448c797a148d2ea1a665ed2a /ld
parenta9353e608e5924c4208fae93e139d8f23b49f996 (diff)
downloadgdb-bc251d509b711b2db0a1aa269c432d23be019f84.zip
gdb-bc251d509b711b2db0a1aa269c432d23be019f84.tar.gz
gdb-bc251d509b711b2db0a1aa269c432d23be019f84.tar.bz2
* emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
Don't prepend "warning" to the message. * testsuite/ld-elf/warn2.d: New. * testsuite/ld-elf/symbol2w.s: New. * testsuite/ld-elf/symbol2ref.s: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/emultempl/elf32.em10
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-elf/symbol2ref.s3
-rw-r--r--ld/testsuite/ld-elf/symbol2w.s6
-rw-r--r--ld/testsuite/ld-elf/warn2.d15
6 files changed, 38 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 239a7f1..f3e1383 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2006-11-06 Vladimir Prus <vladimir@codesourcery.com>
+
+ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
+ Don't prepend "warning" to the message.
+
2006-10-31 Pedro Alves <pedro_alves@portugalmail.pt>
* pe-dll.c (autofilter_entry_type): Change name to const.
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index 99fb8ab..ff48c56 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -1180,10 +1180,8 @@ ${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;
@@ -1193,14 +1191,12 @@ ${ELF_INTERPRETER_SET_DEFAULT}
continue;
sz = s->size;
- 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,
+ msg = xmalloc ((size_t) (sz + 1));
+ if (! bfd_get_section_contents (is->the_bfd, s, msg,
(file_ptr) 0, sz))
einfo ("%F%B: Can't read contents of section .gnu.warning: %E\n",
is->the_bfd);
- msg[prefix_len + sz] = '\0';
+ msg[sz] = '\0';
ret = link_info.callbacks->warning (&link_info, msg,
(const char *) NULL,
is->the_bfd, (asection *) NULL,
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index b4b866c..0d0cb71 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2006-11-06 Vladimir Prus <vladimir@codesourcery.com>
+
+ * testsuite/ld-elf/warn2.d: New.
+ * testsuite/ld-elf/symbol2w.s: New.
+ * testsuite/ld-elf/symbol2ref.s: New.
+
2006-11-05 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/ldsym1.d: Adjust for semi-recent ld changes.
diff --git a/ld/testsuite/ld-elf/symbol2ref.s b/ld/testsuite/ld-elf/symbol2ref.s
new file mode 100644
index 0000000..d2710f9
--- /dev/null
+++ b/ld/testsuite/ld-elf/symbol2ref.s
@@ -0,0 +1,3 @@
+ .text
+ .dc.a Foo
+
diff --git a/ld/testsuite/ld-elf/symbol2w.s b/ld/testsuite/ld-elf/symbol2w.s
new file mode 100644
index 0000000..2452b2b
--- /dev/null
+++ b/ld/testsuite/ld-elf/symbol2w.s
@@ -0,0 +1,6 @@
+ .section .gnu.warning,"a",@progbits
+ .global Foo
+ .type Foo, @object
+ .size Foo, 20
+Foo:
+ .string "function 'Foo' used"
diff --git a/ld/testsuite/ld-elf/warn2.d b/ld/testsuite/ld-elf/warn2.d
new file mode 100644
index 0000000..864db83
--- /dev/null
+++ b/ld/testsuite/ld-elf/warn2.d
@@ -0,0 +1,15 @@
+#source: start.s
+#source: symbol2ref.s
+#source: symbol2w.s
+#ld: -T group.ld
+#warning: ^[^\\n]*\.[obj]+: warning: function 'Foo' used$
+#readelf: -s
+#notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"
+#xfail: "arc-*-*" "d30v-*-*" "dlx-*-*" "i960-*-*" "or32-*-*" "pj-*-*"
+
+# Check that warnings are generated for the symbols in .gnu.warning
+# construct and that the symbol still appears as expected.
+
+#...
+[ ]+[0-9]+:[ ]+[0-9a-f]+[ ]+20[ ]+OBJECT[ ]+GLOBAL DEFAULT[ ]+1 Foo
+#pass