diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-04-06 20:08:50 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1993-04-06 20:08:50 +0000 |
commit | 786757a9a4e43e7c67931c920f306b86f22bc229 (patch) | |
tree | c5d17a62734297f2883fbc06cfcaae8650bb6503 /gdb/xcoffread.c | |
parent | 0c101d4920e41f12945049221da74cad1146a850 (diff) | |
download | gdb-786757a9a4e43e7c67931c920f306b86f22bc229.zip gdb-786757a9a4e43e7c67931c920f306b86f22bc229.tar.gz gdb-786757a9a4e43e7c67931c920f306b86f22bc229.tar.bz2 |
* xcoffread.c (read_xcoff_symtab): Deal correctly with symbols of
exactly 8 characters.
Diffstat (limited to 'gdb/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index cbe5f2c..443b19f 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -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; |