* xcoffread.c (read_xcoff_symtab): Deal correctly with symbols of
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 6 Apr 1993 20:08:50 +0000 (20:08 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 6 Apr 1993 20:08:50 +0000 (20:08 +0000)
exactly 8 characters.

gdb/ChangeLog
gdb/xcoffread.c

index 4533c5db8eb091a71ba5f0a0dd8851e239a75eaa..243cee83a085500c0e5d0ccca1f40e0d981a754c 100644 (file)
@@ -1,3 +1,8 @@
+Tue Apr  6 09:54:29 1993  Jim Kingdon  (kingdon@cygnus.com)
+
+       * xcoffread.c (read_xcoff_symtab): Deal correctly with symbols of
+       exactly 8 characters.
+
 Tue Apr  6 10:31:26 1993  Stu Grossman  (grossman@cygnus.com)
 
        * configure.in:  Sparclite uses sparc config dir.  Also has it's
index cbe5f2cc56d37f57a32d7ad77af3252e2a59cecb..443b19f58a393163f45381618be2452da19fb879 100644 (file)
@@ -1064,6 +1064,16 @@ read_xcoff_symtab (objfile, nsyms)
           pointed to by cs->c_name will persist throughout xcoffread.  If
           we use the new field, it gets overwritten for each symbol.  */
        cs->c_name = ((struct external_syment *)raw_symbol)->e.e_name;
+       /* If it's exactly 8 characters long it isn't '\0'-terminated.  */
+       if (cs->c_name[7] != '\0')
+         {
+           char *p;
+           p = obstack_alloc (&objfile->symbol_obstack, 9);
+           strncpy (p, cs->c_name, 8);
+           p[8] = '\0';
+           cs->c_name = p;
+           symname_alloced = 1;
+         }
       } else if (symbol->n_sclass & 0x80) {
        cs->c_name = debugsec + symbol->n_offset;
        symname_alloced = 0;