summaryrefslogtreecommitdiff
path: root/ld/deffilep.y
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2003-03-13 09:39:09 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2003-03-13 09:39:09 +0000
commit682b28aad2164dd0cccee3a5a72edad1be8092b5 (patch)
treeb13bc102f8d8303b46e78324474bb126259c68d8 /ld/deffilep.y
parent4f501278e9c8963570dfaa4736309ecc1910fd35 (diff)
downloadbinutils-redhat-682b28aad2164dd0cccee3a5a72edad1be8092b5.tar.gz
* deffilep.y (def_import): Use default extension of "dll"
if no extension provided in parsed IMPORT definition. * deffilep.y (def_lex): Revert 2003-03-12 change. (dot_name): New id type and rule. (expline): Use instead of ID. (opt_equal_name): Likewise.
Diffstat (limited to 'ld/deffilep.y')
-rw-r--r--ld/deffilep.y28
1 files changed, 17 insertions, 11 deletions
diff --git a/ld/deffilep.y b/ld/deffilep.y
index 08c5a9142e..529b826113 100644
--- a/ld/deffilep.y
+++ b/ld/deffilep.y
@@ -116,7 +116,7 @@ static const char *lex_parse_string_end = 0;
%token <number> NUMBER
%type <number> opt_base opt_ordinal
%type <number> attr attr_list opt_number exp_opt_list exp_opt
-%type <id> opt_name opt_equal_name
+%type <id> opt_name opt_equal_name dot_name
%%
@@ -151,7 +151,7 @@ expline:
/* The opt_comma is necessary to support both the usual
DEF file syntax as well as .drectve syntax which
mandates <expsym>,<expoptlist>. */
- ID opt_equal_name opt_ordinal opt_comma exp_opt_list
+ dot_name opt_equal_name opt_ordinal opt_comma exp_opt_list
{ def_exports ($1, $2, $3, $5); }
;
exp_opt_list:
@@ -231,7 +231,7 @@ opt_ordinal:
;
opt_equal_name:
- '=' ID { $$ = $2; }
+ '=' dot_name { $$ = $2; }
| { $$ = 0; }
;
@@ -239,6 +239,14 @@ opt_base: BASE '=' NUMBER { $$ = $3;}
| { $$ = 0;}
;
+dot_name: ID { $$ = $1; }
+ | dot_name '.' ID
+ {
+ char * name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
+ sprintf (name, "%s.%s", $1, $3);
+ $$ = name;
+ }
+ ;
%%
@@ -799,13 +807,11 @@ def_import (internal_name, module, dllext, name, ordinal)
int ordinal;
{
char *buf = 0;
-
- if (dllext != NULL)
- {
- buf = (char *) xmalloc (strlen (module) + strlen (dllext) + 2);
- sprintf (buf, "%s.%s", module, dllext);
- module = buf;
- }
+ const char *ext = dllext ? dllext : "dll";
+
+ buf = (char *) xmalloc (strlen (module) + strlen (ext) + 2);
+ sprintf (buf, "%s.%s", module, ext);
+ module = buf;
def_file_add_import (def, name, module, ordinal, internal_name);
if (buf)
@@ -1020,7 +1026,7 @@ def_lex ()
#endif
}
- while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@.", c)))
+ while (c != EOF && (ISALNUM (c) || strchr ("$:-_?/@", c)))
{
put_buf (c);
c = def_getc ();