]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ld/
authorVladimir Prus <vladimir@codesourcery.com>
Sat, 4 Nov 2006 10:20:53 +0000 (10:20 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Sat, 4 Nov 2006 10:20:53 +0000 (10:20 +0000)
        * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
        Don't prepend "warning" to the message.

        ld/testsuite
        * ld-elf/warn2.d: New.
        * ld-elf/symbol2w.s: New.
        * ld-elf/symbol2ref.s: New.

ChangeLog.csl
ld/emultempl/elf32.em
ld/testsuite/ld-elf/symbol2ref.s [new file with mode: 0644]
ld/testsuite/ld-elf/symbol2w.s [new file with mode: 0644]
ld/testsuite/ld-elf/warn2.d [new file with mode: 0644]

index fbb65ad8edf6839ddabef0c75a0cb10279257e2c..10dcb6e3bd41efdafc4018002ee5079be9fc2b34 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-04  Vladimir Prus  <vladimir@codesourcery.com>
+
+       ld/
+       * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation):
+       Don't prepend "warning" to the message.
+
+       ld/testsuite    
+       * ld-elf/warn2.d: New.
+       * ld-elf/symbol2w.s: New.
+       * ld-elf/symbol2ref.s: New.     
+
 2006-10-31  Mark Shinwell  <shinwell@codesourcery.com>
 
        gas/
index 19259796053997913c3469cf763e81207bee484a..ffc5f24eef126b936c46e3aea30171b934b422a0 100644 (file)
@@ -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/ld-elf/symbol2ref.s b/ld/testsuite/ld-elf/symbol2ref.s
new file mode 100644 (file)
index 0000000..c3a40d8
--- /dev/null
@@ -0,0 +1,3 @@
+       .text
+       .long Foo
+
diff --git a/ld/testsuite/ld-elf/symbol2w.s b/ld/testsuite/ld-elf/symbol2w.s
new file mode 100644 (file)
index 0000000..2452b2b
--- /dev/null
@@ -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 (file)
index 0000000..9809a78
--- /dev/null
@@ -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[      ]+ABS Foo
+#pass