X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Fldlex.l;h=aa06d5460d9835a5c2dcf5189539d20d60aa5793;hb=fde6c81990c82b00f737cec2d781458de2ac84e1;hp=56ec39164b4629dd8905bc12ccd7c26175286b12;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/ldlex.l b/ld/ldlex.l index 56ec39164b..aa06d5460d 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -1,35 +1,29 @@ %{ /* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. + Written by Steve Chamberlain of Cygnus Support. - This file is part of GLD, the Gnu Linker. + This file is part of the GNU Binutils. - GLD is free software; you can redistribute it and/or modify + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. - GLD is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GLD; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ -/* -This was written by steve chamberlain - sac@cygnus.com -*/ - - -#include - -#include "bfd.h" #include "sysdep.h" +#include "bfd.h" #include "safe-ctype.h" #include "bfdlink.h" #include "ld.h" @@ -132,6 +126,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* case input_script: return INPUT_SCRIPT; break; case input_mri_script: return INPUT_MRI_SCRIPT; break; case input_version_script: return INPUT_VERSION_SCRIPT; break; + case input_dynamic_list: return INPUT_DYNAMIC_LIST; break; case input_defsym: return INPUT_DEFSYM; break; default: abort (); } @@ -255,9 +250,10 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "DATA_SEGMENT_END" { RTOKEN(DATA_SEGMENT_END);} "ADDR" { RTOKEN(ADDR);} "LOADADDR" { RTOKEN(LOADADDR);} +"ALIGNOF" { RTOKEN(ALIGNOF); } "MAX" { RTOKEN(MAX_K); } "MIN" { RTOKEN(MIN_K); } -"ASSERT" { RTOKEN(ASSERT_K); } +"ASSERT" { RTOKEN(ASSERT_K); } "ENTRY" { RTOKEN(ENTRY);} "EXTERN" { RTOKEN(EXTERN);} "NEXT" { RTOKEN(NEXT);} @@ -278,6 +274,9 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "FORCE_COMMON_ALLOCATION" { RTOKEN(FORCE_COMMON_ALLOCATION);} "INHIBIT_COMMON_ALLOCATION" { RTOKEN(INHIBIT_COMMON_ALLOCATION);} "SECTIONS" { RTOKEN(SECTIONS);} +"INSERT" { RTOKEN(INSERT_K);} +"AFTER" { RTOKEN(AFTER);} +"BEFORE" { RTOKEN(BEFORE);} "FILL" { RTOKEN(FILL);} "STARTUP" { RTOKEN(STARTUP);} "OUTPUT_FORMAT" { RTOKEN(OUTPUT_FORMAT);} @@ -308,7 +307,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "org" { RTOKEN(ORIGIN);} "l" { RTOKEN( LENGTH);} "len" { RTOKEN( LENGTH);} -"INCLUDE" { RTOKEN(INCLUDE);} +"INCLUDE" { RTOKEN(INCLUDE);} "PHDRS" { RTOKEN (PHDRS); } "AT" { RTOKEN(AT);} "SUBALIGN" { RTOKEN(SUBALIGN);} @@ -316,6 +315,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* "PROVIDE_HIDDEN" { RTOKEN(PROVIDE_HIDDEN); } "KEEP" { RTOKEN(KEEP); } "EXCLUDE_FILE" { RTOKEN(EXCLUDE_FILE); } +"CONSTANT" { RTOKEN(CONSTANT);} "#".*\n? { ++ lineno; } "\n" { ++ lineno; RTOKEN(NEWLINE); } "*".* { /* Mri comment line */ } @@ -363,11 +363,19 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* } -{FILENAMECHAR1}{FILENAMECHAR}* { +{FILENAMECHAR1}{FILENAMECHAR}* { + yylval.name = xstrdup (yytext); + return NAME; + } +"-l"{FILENAMECHAR}+ { + yylval.name = xstrdup (yytext + 2); + return LNAME; + } +{FILENAMECHAR1}{NOCFILENAMECHAR}* { yylval.name = xstrdup (yytext); return NAME; } -"-l"{FILENAMECHAR}+ { +"-l"{NOCFILENAMECHAR}+ { yylval.name = xstrdup (yytext + 2); return LNAME; }