ld: elfvers tests: support symbol prefixed targets
[deliverable/binutils-gdb.git] / ld / ldlex.l
index 62610cffed01df987097b0cc9ac13b7c8b60b06c..7f038b32a4aec27cd0965adc56b115885727f254 100644 (file)
@@ -1,7 +1,9 @@
+%option nounput
+
 %{
 
 /* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2007
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support.
 
@@ -22,7 +24,6 @@
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
-#include "sysdep.h"
 #include "bfd.h"
 #include "safe-ctype.h"
 #include "bfdlink.h"
@@ -57,7 +58,7 @@ const char *lex_string = NULL;
    Otherwise, stack elements 0 through `include_stack_ptr - 1' are valid.  */
 
 #undef YY_INPUT
-#define YY_INPUT(buf,result,max_size) yy_input (buf, &result, max_size)
+#define YY_INPUT(buf,result,max_size) result = yy_input (buf, max_size)
 
 #define YY_NO_UNPUT
 
@@ -68,7 +69,7 @@ static unsigned int lineno_stack[MAX_INCLUDE_DEPTH];
 static unsigned int include_stack_ptr = 0;
 static int vers_node_nesting = 0;
 
-static void yy_input (char *, int *, int);
+static int yy_input (char *, int);
 static void comment (void);
 static void lex_warn_invalid (char *where, char *what);
 
@@ -98,7 +99,7 @@ CMDFILENAMECHAR1  [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~]
 FILENAMECHAR1  [_a-zA-Z\/\.\\\$\_\~]
 SYMBOLCHARN     [_a-zA-Z\/\.\\\$\_\~0-9]
 FILENAMECHAR   [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
-WILDCHAR       [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
+WILDCHAR       [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*\^\!]
 WHITE          [ \t\n\r]+
 
 NOCFILENAMECHAR        [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
@@ -239,6 +240,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <BOTH,SCRIPT,EXPRESSION,MRI>":"                { RTOKEN(':'); }
 <BOTH,SCRIPT,EXPRESSION,MRI>";"                { RTOKEN(';');}
 <BOTH,SCRIPT>"MEMORY"                  { RTOKEN(MEMORY);}
+<BOTH,SCRIPT>"REGION_ALIAS"            { RTOKEN(REGION_ALIAS);}
 <BOTH,SCRIPT,EXPRESSION>"ORIGIN"       { RTOKEN(ORIGIN);}
 <BOTH,SCRIPT>"VERSION"                 { RTOKEN(VERSIONK);}
 <EXPRESSION,BOTH,SCRIPT>"BLOCK"                { RTOKEN(BLOCK);}
@@ -307,7 +309,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
 <BOTH,SCRIPT>"org"                     { RTOKEN(ORIGIN);}
 <BOTH,SCRIPT>"l"                       { RTOKEN( LENGTH);}
 <BOTH,SCRIPT>"len"                     { RTOKEN( LENGTH);}
-<BOTH,SCRIPT>"INCLUDE"                 { RTOKEN(INCLUDE);}
+<EXPRESSION,BOTH,SCRIPT>"INCLUDE"      { RTOKEN(INCLUDE);}
 <BOTH,SCRIPT>"PHDRS"                   { RTOKEN (PHDRS); }
 <EXPRESSION,BOTH,SCRIPT>"AT"           { RTOKEN(AT);}
 <EXPRESSION,BOTH,SCRIPT>"SUBALIGN"     { RTOKEN(SUBALIGN);}
@@ -607,22 +609,23 @@ ldlex_popstate (void)
 }
 \f
 
-/* Place up to MAX_SIZE characters in BUF and return in *RESULT
+/* Place up to MAX_SIZE characters in BUF and return
    either the number of characters read, or 0 to indicate EOF.  */
 
-static void
-yy_input (char *buf, int *result, int max_size)
+static int
+yy_input (char *buf, int max_size)
 {
-  *result = 0;
+  int result = 0;
   if (YY_CURRENT_BUFFER->yy_input_file)
     {
       if (yyin)
        {
-         *result = fread (buf, 1, max_size, yyin);
-         if (*result < max_size && ferror (yyin))
+         result = fread (buf, 1, max_size, yyin);
+         if (result < max_size && ferror (yyin))
            einfo ("%F%P: read in flex scanner failed\n");
        }
     }
+  return result;
 }
 
 /* Eat the rest of a C-style comment.  */
This page took 0.025194 seconds and 4 git commands to generate.