aboutsummaryrefslogtreecommitdiff
path: root/binutils/defparse.y
diff options
context:
space:
mode:
authorKai Tietz <kai.tietz@onevision.com>2009-10-23 14:53:57 +0000
committerKai Tietz <kai.tietz@onevision.com>2009-10-23 14:53:57 +0000
commitbf201fddaaaae8fbd048f6d58b315080f5069b9f (patch)
tree61af7147e3b585fbd897a63f51be9cd3b6055107 /binutils/defparse.y
parent6a0fa04300e300a1df9cc137f868a91be3854225 (diff)
downloadgdb-bf201fddaaaae8fbd048f6d58b315080f5069b9f.zip
gdb-bf201fddaaaae8fbd048f6d58b315080f5069b9f.tar.gz
gdb-bf201fddaaaae8fbd048f6d58b315080f5069b9f.tar.bz2
2009-10-23 Kai Tietz <kai.tietz@onevision.com>
* deflex.l: Allow '<' and '>' in ID names. * defparse.y (EQUAL): New token constant. (opt_import_name): New rule for emptry or '==' ID. (expline): Add opt_import_name as last line element. (impline): Likewise. * dlltool.c (ifunct): New member its_name. (export): Likewise. (append_import): Add its_name argument. (defexports): Likewise. (defimport): Likewise. (scan_drectve_symbols): Adjust calls to def_exports. (dump_def_info): Print new optinal import/export table symbol name. (generate_idata_ofile): Use its_name member. (make_one_lib_file): Likewise. (nfunc): Take its_name in account on sort. * dlltool.h (def_exports): Add its_name as argument. (def_import): Likewise. * doc/binutils.texi: Add new def file syntax extension. * deflex.l (EQUAL): Add rule for '=='. * NEWS: Mention new feature. 2009-10-23 Kai Tietz <kai.tietz@onevision.com> * binutils-all/dlltool.exp: Add new test. * binutils-all/alias-2.def: New file.
Diffstat (limited to 'binutils/defparse.y')
-rw-r--r--binutils/defparse.y35
1 files changed, 25 insertions, 10 deletions
diff --git a/binutils/defparse.y b/binutils/defparse.y
index 6493c12..c05254a 100644
--- a/binutils/defparse.y
+++ b/binutils/defparse.y
@@ -35,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> ID
%token <number> NUMBER
%type <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA opt_PRIVATE
%type <number> attr attr_list opt_number
-%type <id> opt_name opt_equal_name
+%type <id> opt_name opt_equal_name opt_import_name
%%
@@ -70,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
@@ -78,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:
@@ -155,6 +165,11 @@ opt_ordinal:
| { $$=-1;}
;
+opt_import_name:
+ EQUAL ID { $$ = $2; }
+ | { $$ = 0; }
+ ;
+
opt_equal_name:
'=' ID { $$ = $2; }
| '=' ID '.' ID