diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-09-20 18:39:25 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1994-09-20 18:39:25 +0000 |
commit | 602d41e523e7f1ee427c34740cb2d5996bf7a0d4 (patch) | |
tree | 21dfcc6f3ecc780d441c969d65a6fd4808d08fba | |
parent | 57b2362f55003a09c09027132007d556aa6443bb (diff) | |
download | gdb-602d41e523e7f1ee427c34740cb2d5996bf7a0d4.zip gdb-602d41e523e7f1ee427c34740cb2d5996bf7a0d4.tar.gz gdb-602d41e523e7f1ee427c34740cb2d5996bf7a0d4.tar.bz2 |
* coffread.c (init_stringtab): When copying length to stringtab,
use target format, not host format, since that is what the rest of
the code assumes.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/coffread.c | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8d09fc2..2dcb039 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Tue Sep 20 11:34:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com) + + * coffread.c (init_stringtab): When copying length to stringtab, + use target format, not host format, since that is what the rest of + the code assumes. + Mon Sep 19 15:48:10 1994 J.T. Conklin (jtc@phishhead.cygnus.com) * Makefile.in: Removed prelude.o, i386-nlmstub.o, nlmstub.o, diff --git a/gdb/coffread.c b/gdb/coffread.c index 0706665..9350d45 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1085,7 +1085,9 @@ init_stringtab (abfd, offset) return 0; stringtab = (char *) xmalloc (length); - memcpy (stringtab, &length, sizeof length); + /* This is in target format (probably not very useful, and not currently + used), not host format. */ + memcpy (stringtab, lengthbuf, sizeof lengthbuf); if (length == sizeof length) /* Empty table -- just the count */ return 0; @@ -1113,6 +1115,8 @@ getsymname (symbol_entry) if (symbol_entry->_n._n_n._n_zeroes == 0) { + /* FIXME: Probably should be detecting corrupt symbol files by + seeing whether offset points to within the stringtab. */ result = stringtab + symbol_entry->_n._n_n._n_offset; } else |