gas/
authorJan Beulich <jbeulich@novell.com>
Mon, 27 Jul 2009 10:04:25 +0000 (10:04 +0000)
committerJan Beulich <jbeulich@novell.com>
Mon, 27 Jul 2009 10:04:25 +0000 (10:04 +0000)
2009-07-27  Jan Beulich  <jbeulich@novell.com>

* obj-elf.c (elf_file_symbol): Replace symbol name set up by
symbol_new() with the passed in, unmodified one.

gas/testsuite/
2009-07-27  Jan Beulich  <jbeulich@novell.com>

* gas/elf/file.[ds]: New.
* gas/elf/elf.exp: Run new test.

gas/ChangeLog
gas/config/obj-elf.c
gas/testsuite/ChangeLog
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/file.d [new file with mode: 0644]
gas/testsuite/gas/elf/file.s [new file with mode: 0644]

index ffeb31c48792562fc5f81d178fd130efe0870b92..122b42724c903b90e48aea6131381637f5e9273a 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-27  Jan Beulich  <jbeulich@novell.com>
+
+       * obj-elf.c (elf_file_symbol): Replace symbol name set up by
+       symbol_new() with the passed in, unmodified one.
+
 2009-07-27  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
 
        * config/tc-cr16.c (md_apply_fix): Put the addend value alone in to
index f85267bb774095a73a7e9292397eb0d1fd96bb36..51cd3a9ff1f2f60db7ac293ee183d7cc5a24a5d3 100644 (file)
@@ -260,9 +260,20 @@ elf_file_symbol (const char *s, int appfile)
       || (symbol_rootP->bsym->flags & BSF_FILE) == 0)
     {
       symbolS *sym;
+      unsigned int name_length;
 
       sym = symbol_new (s, absolute_section, 0, NULL);
       symbol_set_frag (sym, &zero_address_frag);
+
+      name_length = strlen (s);
+      if (name_length > strlen (S_GET_NAME (sym)))
+       {
+         obstack_grow (&notes, s, name_length + 1);
+         S_SET_NAME (sym, obstack_finish (&notes));
+       }
+      else
+       strcpy ((char *) S_GET_NAME (sym), s);
+
       symbol_get_bfdsym (sym)->flags |= BSF_FILE;
 
       if (symbol_rootP != sym)
index 2769e04c403bed82b44ecea716df66bdefefb70d..ebe6b7ee41b604e377c5692efa4cdc9f8758ee11 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-27  Jan Beulich  <jbeulich@novell.com>
+
+       * gas/elf/file.[ds]: New.
+       * gas/elf/elf.exp: Run new test.
+
 2009-07-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gas/i386/l1om.d: New.
index 454aa60491bd82a453ea71b2584c1e5f5f46fdc9..65245f4e8a6e89328657bbc698ddaa4f1f87a052 100644 (file)
@@ -82,6 +82,20 @@ if { ([istarget "*-*-*elf*"]
        && ![istarget "am3*-*-*"]} then {    
       run_dump_test "ehopt0"
     }
+    case $target_triplet in {
+       { m68k-*-* m68[03]??-*-* } {
+           run_dump_test "file" { { as "--defsym m68k=1" } }
+       }
+       { mmix-*-* } {
+           run_dump_test "file" { { as "--defsym mmix=1" } }
+       }
+       { xtensa*-*-* } {
+           run_dump_test "file" { { as "--rename-section file.s=file.c" } }
+       }
+       default {
+           run_dump_test "file"
+       }
+    }
     run_dump_test "group0a" 
     run_dump_test "group0b" 
     run_dump_test "group1a" 
diff --git a/gas/testsuite/gas/elf/file.d b/gas/testsuite/gas/elf/file.d
new file mode 100644 (file)
index 0000000..1e98186
--- /dev/null
@@ -0,0 +1,18 @@
+#objdump: -t
+#name: .file file names
+
+.*: .*
+
+SYMBOL TABLE:
+#...
+0+ l[ ]*df \*ABS\*[    ]+0+ file\.s
+0+ l[ ]*df \*ABS\*[    ]+0+ slash/data
+0+ l[ ]*df \*ABS\*[    ]+0+ \{braces\}
+0+ l[ ]*df \*ABS\*[    ]+0+ \[brackets\]
+0+ l[ ]*df \*ABS\*[    ]+0+ /dir/file\.s
+0+ l[ ]*df \*ABS\*[    ]+0+ :colon
+0+ l[ ]*df \*ABS\*[    ]+0+ UPPER
+0+ l[ ]*df \*ABS\*[    ]+0+ lower
+0+ l[ ]*df \*ABS\*[    ]+0+ hash\#
+0+ l[ ]*df \*ABS\*[    ]+0+ ~tilde
+#pass
diff --git a/gas/testsuite/gas/elf/file.s b/gas/testsuite/gas/elf/file.s
new file mode 100644 (file)
index 0000000..7718cc7
--- /dev/null
@@ -0,0 +1,29 @@
+       # delta (m68k sub-target)
+       .file "~tilde"
+
+       # ia64
+       .file "hash#"
+
+       # m68k
+       .ifdef m86k
+       .opt nocase
+       .endif
+       .file "lower"
+       .file "UPPER"
+
+       # mmix
+       .file ":colon"
+       .ifdef mmix
+       .prefix prefix
+       .endif
+       .file "/dir/file.s"
+
+       # ppc/xcoff
+       .file "[brackets]"
+       .file "{braces}"
+
+       # thumb (arm sub-target)
+       .file "slash/data"
+
+       # xtensa (through --rename-section file.s=file.c)
+       .file "file.s"
This page took 0.03031 seconds and 4 git commands to generate.