X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=binutils%2Fdefparse.y;h=c05254a0557497b37febb2f526ec972e28e7899e;hb=6036c742216f95a45095562947749755601a61f5;hp=b384592b73590a9e857541382578319e2b8101fe;hpb=aef6203bd6d412d65f539a41f1abd07b14d7a05d;p=binutils-gdb.git diff --git a/binutils/defparse.y b/binutils/defparse.y index b384592b735..c05254a0557 100644 --- a/binutils/defparse.y +++ b/binutils/defparse.y @@ -1,26 +1,28 @@ %{ /* defparse.y - parser for .def files */ -/* Copyright 1995, 1997, 1998, 1999, 2001, 2004 - Free Software Foundation, Inc. - - This file is part of GNU Binutils. - - 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 of the License, or - (at your option) any later version. - - 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 this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - +/* Copyright 1995, 1997, 1998, 1999, 2001, 2004, 2005, 2007 + Free Software Foundation, Inc. + + This file is part of GNU Binutils. + + 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 3 of the License, or + (at your option) any later version. + + 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#include "sysdep.h" #include "bfd.h" -#include "bucomm.h" +#include "libiberty.h" #include "dlltool.h" %} @@ -33,11 +35,12 @@ %token SECTIONS EXPORTS IMPORTS VERSIONK BASE CONSTANT %token READ WRITE EXECUTE SHARED NONSHARED NONAME PRIVATE %token SINGLE MULTIPLE INITINSTANCE INITGLOBAL TERMINSTANCE TERMGLOBAL +%token EQUAL %token ID %token NUMBER %type opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA opt_PRIVATE %type attr attr_list opt_number -%type opt_name opt_equal_name +%type opt_name opt_equal_name opt_import_name %% @@ -68,7 +71,8 @@ explist: expline: ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT opt_DATA opt_PRIVATE - { def_exports ($1, $2, $3, $4, $5, $6, $7);} + opt_import_name + { def_exports ($1, $2, $3, $4, $5, $6, $7, $8);} ; implist: implist impline @@ -76,14 +80,22 @@ implist: ; impline: - ID '=' ID '.' ID '.' ID { def_import ($1,$3,$5,$7, 0); } - | ID '=' ID '.' ID '.' NUMBER { def_import ($1,$3,$5, 0,$7); } - | ID '=' ID '.' ID { def_import ($1,$3, 0,$5, 0); } - | ID '=' ID '.' NUMBER { def_import ($1,$3, 0, 0,$5); } - | ID '.' ID '.' ID { def_import ( 0,$1,$3,$5, 0); } - | ID '.' ID '.' NUMBER { def_import ( 0,$1,$3, 0,$5); } - | ID '.' ID { def_import ( 0,$1, 0,$3, 0); } - | ID '.' NUMBER { def_import ( 0,$1, 0, 0,$3); } + ID '=' ID '.' ID '.' ID opt_import_name + { def_import ($1,$3,$5,$7, 0, $8); } + | ID '=' ID '.' ID '.' NUMBER opt_import_name + { def_import ($1,$3,$5, 0,$7, $8); } + | ID '=' ID '.' ID opt_import_name + { def_import ($1,$3, 0,$5, 0, $6); } + | ID '=' ID '.' NUMBER opt_import_name + { def_import ($1,$3, 0, 0,$5, $6); } + | ID '.' ID '.' ID opt_import_name + { def_import ( 0,$1,$3,$5, 0, $6); } + | ID '.' ID '.' NUMBER opt_import_name + { def_import ( 0,$1,$3, 0,$5, $6); } + | ID '.' ID opt_import_name + { def_import ( 0,$1, 0,$3, 0, $4); } + | ID '.' NUMBER opt_import_name + { def_import ( 0,$1, 0, 0,$3, $4); } ; seclist: @@ -153,6 +165,11 @@ opt_ordinal: | { $$=-1;} ; +opt_import_name: + EQUAL ID { $$ = $2; } + | { $$ = 0; } + ; + opt_equal_name: '=' ID { $$ = $2; } | '=' ID '.' ID