summaryrefslogtreecommitdiff
path: root/ld/deffilep.y
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-11-06 19:36:20 +0000
committerNick Clifton <nickc@redhat.com>2002-11-06 19:36:20 +0000
commitfb3643f4833378632c66a745912f0d0f8c9b2cea (patch)
treea973ce4b9ee36feed2308d9a3490df1d7aa8b168 /ld/deffilep.y
parent02becfee199d4ccfa4e73e97f1d5cac81f952e91 (diff)
downloadbinutils-redhat-fb3643f4833378632c66a745912f0d0f8c9b2cea.tar.gz
Adds support for fastcall symbols as used on Microsoft Windows platforms
(i386)
Diffstat (limited to 'ld/deffilep.y')
-rw-r--r--ld/deffilep.y39
1 files changed, 30 insertions, 9 deletions
diff --git a/ld/deffilep.y b/ld/deffilep.y
index 51d17f8a70..e9a63108e3 100644
--- a/ld/deffilep.y
+++ b/ld/deffilep.y
@@ -1,6 +1,6 @@
%{ /* deffilep.y - parser for .def files */
-/* Copyright 1995, 1997, 1998, 1999, 2000, 2001
+/* Copyright 1995, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -966,9 +966,27 @@ def_lex ()
return NUMBER;
}
- if (ISALPHA (c) || strchr ("$:-_?", c))
+ if (ISALPHA (c) || strchr ("$:-_?@", c))
{
bufptr = 0;
+ q = c;
+ put_buf (c);
+ c = def_getc ();
+
+ if (q == '@')
+ {
+ if (ISBLANK (c) ) /* '@' followed by whitespace. */
+ return (q);
+ else if (ISDIGIT (c)) /* '@' followed by digit. */
+ {
+ def_ungetc (c);
+ return (q);
+ }
+#if TRACE
+ printf ("lex: @ returns itself\n");
+#endif
+ }
+
while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@", c)))
{
put_buf (c);
@@ -976,14 +994,17 @@ def_lex ()
}
if (c != EOF)
def_ungetc (c);
- for (i = 0; tokens[i].name; i++)
- if (strcmp (tokens[i].name, buffer) == 0)
- {
+ if (ISALPHA (q)) /* Check for tokens. */
+ {
+ for (i = 0; tokens[i].name; i++)
+ if (strcmp (tokens[i].name, buffer) == 0)
+ {
#if TRACE
- printf ("lex: `%s' is a string token\n", buffer);
+ printf ("lex: `%s' is a string token\n", buffer);
#endif
- return tokens[i].token;
- }
+ return tokens[i].token;
+ }
+ }
#if TRACE
printf ("lex: `%s' returns ID\n", buffer);
#endif
@@ -1008,7 +1029,7 @@ def_lex ()
return ID;
}
- if (c == '=' || c == '.' || c == '@' || c == ',')
+ if (c == '=' || c == '.' || c == ',')
{
#if TRACE
printf ("lex: `%c' returns itself\n", c);