aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>1992-07-23 19:43:08 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1992-07-23 19:43:08 +0000
commit09927bb00b0bd8103615274d8c908495d4ff04c0 (patch)
tree5d18e9719f3b1c83eb7cc4fcfbe39f5b4f0a0289 /gcc
parent110de73f7bf271d2f70cf5ce6c517bcccb02df70 (diff)
downloadgcc-09927bb00b0bd8103615274d8c908495d4ff04c0.zip
gcc-09927bb00b0bd8103615274d8c908495d4ff04c0.tar.gz
gcc-09927bb00b0bd8103615274d8c908495d4ff04c0.tar.bz2
entered into RCS
From-SVN: r1675
Diffstat (limited to 'gcc')
-rw-r--r--gcc/mips-tfile.c54
1 files changed, 48 insertions, 6 deletions
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index 93275e09..58d01cd 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -3729,16 +3729,37 @@ parse_stabs_common (string_start, string_end, rest)
else
{
SYMR *sym_ptr;
- shash_t *shash_ptr = hash_string (p,
- strlen (p) - 1,
- &orig_str_hash[0],
- (symint_t *)0);
+ shash_t *shash_ptr;
+ const char *start, *end_p1;
+
+ start = p;
+ if ((end_p1 = strchr (start, '+')) == (char *)0)
+ {
+ if ((end_p1 = strchr (start, '-')) == (char *)0)
+ end_p1 = start + strlen(start) - 1;
+ }
+
+ shash_ptr = hash_string (start,
+ end_p1 - start,
+ &orig_str_hash[0],
+ (symint_t *)0);
if (shash_ptr == (shash_t *)0
|| (sym_ptr = shash_ptr->sym_ptr) == (SYMR *)0)
{
- error ("Illegal .stabs/.stabn directive, value not found");
- return;
+ shash_ptr = hash_string (start,
+ end_p1 - start,
+ &ext_str_hash[0],
+ (symint_t *)0);
+
+ if (shash_ptr == (shash_t *)0
+ || shash_ptr->esym_ptr == (EXTR *)0)
+ {
+ error ("Illegal .stabs/.stabn directive, value not found");
+ return;
+ }
+ else
+ sym_ptr = &(shash_ptr->esym_ptr->asym);
}
/* Traditionally, N_LBRAC and N_RBRAC are *not* relocated. */
@@ -3753,6 +3774,27 @@ parse_stabs_common (string_start, string_end, rest)
st = (st_t) sym_ptr->st;
}
value = sym_ptr->value;
+
+ ch = *end_p1++;
+ if (ch != '\n')
+ {
+ if (((!isdigit (*end_p1)) && (*end_p1 != '-'))
+ || ((ch != '+') && (ch != '-')))
+ {
+ error ("Illegal .stabs/.stabn directive, badly formed value");
+ return;
+ }
+ if (ch == '+')
+ value += strtol (end_p1, &p, 0);
+ else if (ch == '-')
+ value -= strtol (end_p1, &p, 0);
+
+ if (*p != '\n')
+ {
+ error ("Illegal .stabs/.stabn directive, stuff after numeric value");
+ return;
+ }
+ }
}
code = MIPS_MARK_STAB(code);
}