* defparse.y (opt_equal_name): allow "." in name.
* dlltool.c (def_exports): Added ability to generate forwarded exports. (gen_exp_file): Likewise.
This commit is contained in:
parent
120aa76a7f
commit
04847a4d3e
3 changed files with 41 additions and 7 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2001-03-13 Eric Kohl <ekohl@rz-online.de>
|
||||||
|
|
||||||
|
* defparse.y (opt_equal_name): allow "." in name.
|
||||||
|
* dlltool.c (def_exports): Added ability to generate forwarded exports.
|
||||||
|
(gen_exp_file): Likewise.
|
||||||
|
|
||||||
2001-03-12 Stefan Geuken <mail@stefan-geuken.de>
|
2001-03-12 Stefan Geuken <mail@stefan-geuken.de>
|
||||||
|
|
||||||
* NEWS: Document addition of -B switch to objcopy.
|
* NEWS: Document addition of -B switch to objcopy.
|
||||||
|
|
|
@ -149,6 +149,12 @@ opt_ordinal:
|
||||||
|
|
||||||
opt_equal_name:
|
opt_equal_name:
|
||||||
'=' ID { $$ = $2; }
|
'=' ID { $$ = $2; }
|
||||||
|
| '=' ID '.' ID
|
||||||
|
{
|
||||||
|
char *name = xmalloc (strlen ($2) + 1 + strlen ($4) + 1);
|
||||||
|
sprintf (name, "%s.%s", $2, $4);
|
||||||
|
$$ = name;
|
||||||
|
}
|
||||||
| { $$ = 0; }
|
| { $$ = 0; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,13 @@
|
||||||
LIBRARY <name> [ , <base> ]
|
LIBRARY <name> [ , <base> ]
|
||||||
The result is going to be <name>.DLL
|
The result is going to be <name>.DLL
|
||||||
|
|
||||||
EXPORTS ( <name1> [ = <name2> ] [ @ <integer> ] [ NONAME ] [CONSTANT] [DATA] ) *
|
EXPORTS ( ( ( <name1> [ = <name2> ] )
|
||||||
|
| ( <name1> = <module-name> . <external-name>))
|
||||||
|
[ @ <integer> ] [ NONAME ] [CONSTANT] [DATA] ) *
|
||||||
Declares name1 as an exported symbol from the
|
Declares name1 as an exported symbol from the
|
||||||
DLL, with optional ordinal number <integer>
|
DLL, with optional ordinal number <integer>.
|
||||||
|
Or declares name1 as an alias (forward) of the function <external-name>
|
||||||
|
in the DLL <module-name>.
|
||||||
|
|
||||||
IMPORTS ( ( <internal-name> = <module-name> . <integer> )
|
IMPORTS ( ( <internal-name> = <module-name> . <integer> )
|
||||||
| ( [ <internal-name> = ] <module-name> . <external-name> )) *
|
| ( [ <internal-name> = ] <module-name> . <external-name> )) *
|
||||||
|
@ -636,6 +640,7 @@ typedef struct export
|
||||||
int noname;
|
int noname;
|
||||||
int data;
|
int data;
|
||||||
int hint;
|
int hint;
|
||||||
|
int forward; /* number of forward label, 0 means no forward */
|
||||||
struct export *next;
|
struct export *next;
|
||||||
}
|
}
|
||||||
export_type;
|
export_type;
|
||||||
|
@ -848,6 +853,7 @@ static export_type *d_exports; /*list of exported functions */
|
||||||
static export_type **d_exports_lexically; /* vector of exported functions in alpha order */
|
static export_type **d_exports_lexically; /* vector of exported functions in alpha order */
|
||||||
static dlist_type *d_list; /* Descriptions */
|
static dlist_type *d_list; /* Descriptions */
|
||||||
static dlist_type *a_list; /* Stuff to go in directives */
|
static dlist_type *a_list; /* Stuff to go in directives */
|
||||||
|
static int d_nforwards = 0; /* Number of forwarded exports */
|
||||||
|
|
||||||
static int d_is_dll;
|
static int d_is_dll;
|
||||||
static int d_is_exe;
|
static int d_is_exe;
|
||||||
|
@ -882,6 +888,12 @@ def_exports (name, internal_name, ordinal, noname, constant, data)
|
||||||
p->next = d_exports;
|
p->next = d_exports;
|
||||||
d_exports = p;
|
d_exports = p;
|
||||||
d_nfuncs++;
|
d_nfuncs++;
|
||||||
|
|
||||||
|
if ((internal_name != NULL)
|
||||||
|
&& (strchr (internal_name, '.') != NULL))
|
||||||
|
p->forward = ++d_nforwards;
|
||||||
|
else
|
||||||
|
p->forward = 0; /* no forward */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1819,9 +1831,14 @@ gen_exp_file ()
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
|
|
||||||
ASM_PREFIX,
|
if (exp->forward == 0)
|
||||||
exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
|
fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE,
|
||||||
|
ASM_PREFIX,
|
||||||
|
exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal);
|
||||||
|
else
|
||||||
|
fprintf (f, "\t%sf%d%s\t%s %d\n", ASM_RVA_BEFORE,
|
||||||
|
exp->forward, ASM_RVA_AFTER, ASM_C, exp->ordinal);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1846,8 +1863,13 @@ gen_exp_file ()
|
||||||
fprintf(f,"%s Export Name Table\n", ASM_C);
|
fprintf(f,"%s Export Name Table\n", ASM_C);
|
||||||
for (i = 0; (exp = d_exports_lexically[i]); i++)
|
for (i = 0; (exp = d_exports_lexically[i]); i++)
|
||||||
if (!exp->noname || show_allnames)
|
if (!exp->noname || show_allnames)
|
||||||
fprintf (f, "n%d: %s \"%s\"\n",
|
{
|
||||||
exp->ordinal, ASM_TEXT, exp->name);
|
fprintf (f, "n%d: %s \"%s\"\n",
|
||||||
|
exp->ordinal, ASM_TEXT, exp->name);
|
||||||
|
if (exp->forward != 0)
|
||||||
|
fprintf (f, "f%d: %s \"%s\"\n",
|
||||||
|
exp->forward, ASM_TEXT, exp->internal_name);
|
||||||
|
}
|
||||||
|
|
||||||
if (a_list)
|
if (a_list)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue