summaryrefslogtreecommitdiff
path: root/binutils/dlltool.c
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-03-09 20:28:49 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2006-03-09 20:28:49 +0000
commit55f221112e1bab8a29dfc90b37b508ebf94d6c5e (patch)
treebf47bdbb0b110ef0d73991f7e1431893420a7f55 /binutils/dlltool.c
parent692cf75600bd7817672cdf312c92dbbf1e357818 (diff)
downloadbinutils-redhat-55f221112e1bab8a29dfc90b37b508ebf94d6c5e.tar.gz
* dlltool.c (add_stdcall_underscore): New flag.
(xlate): Also add underscore to stdcall symbol if add_stdcall_underscore set. (usage): Document --add-stdcall-underscore option. (OPTION_ADD_STDCALL_UNDERSCORE): New define. (long_options): Use it for --add-stdcall-underscore option. (main): Handle it. * doc/binutils.texi: Document --add-stdcall-underscore option and differentiate from --add-underscore.
Diffstat (limited to 'binutils/dlltool.c')
-rw-r--r--binutils/dlltool.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index d8bb03c0a8..d643308320 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -354,6 +354,7 @@ static char *dll_name;
static int add_indirect = 0;
static int add_underscore = 0;
+static int add_stdcall_underscore = 0;
static int dontdeltemps = 0;
/* TRUE if we should export all symbols. Otherwise, we only export
@@ -1994,7 +1995,9 @@ xlate (const char *name)
{
int lead_at = (*name == '@');
- if (add_underscore && !lead_at)
+ if (!lead_at && (add_underscore
+ || (add_stdcall_underscore
+ && strchr (name, '@'))))
{
char *copy = xmalloc (strlen (name) + 2);
@@ -3046,7 +3049,8 @@ usage (FILE *file, int status)
fprintf (file, _(" -b --base-file <basefile> Read linker generated base file.\n"));
fprintf (file, _(" -x --no-idata4 Don't generate idata$4 section.\n"));
fprintf (file, _(" -c --no-idata5 Don't generate idata$5 section.\n"));
- fprintf (file, _(" -U --add-underscore Add underscores to symbols in interface library.\n"));
+ fprintf (file, _(" -U --add-underscore Add underscores to all symbols in interface library.\n"));
+ fprintf (file, _(" --add-stdcall-underscore Add underscores to stdcall symbols in interface library.\n"));
fprintf (file, _(" -k --kill-at Kill @<n> from exported names.\n"));
fprintf (file, _(" -A --add-stdcall-alias Add aliases without @<n>.\n"));
fprintf (file, _(" -p --ext-prefix-alias <prefix> Add aliases with <prefix>.\n"));
@@ -3071,6 +3075,7 @@ usage (FILE *file, int status)
#define OPTION_NO_EXPORT_ALL_SYMS (OPTION_EXPORT_ALL_SYMS + 1)
#define OPTION_EXCLUDE_SYMS (OPTION_NO_EXPORT_ALL_SYMS + 1)
#define OPTION_NO_DEFAULT_EXCLUDES (OPTION_EXCLUDE_SYMS + 1)
+#define OPTION_ADD_STDCALL_UNDERSCORE (OPTION_NO_DEFAULT_EXCLUDES + 1)
static const struct option long_options[] =
{
@@ -3088,6 +3093,7 @@ static const struct option long_options[] =
{"def", required_argument, NULL, 'd'}, /* for compatibility with older versions */
{"input-def", required_argument, NULL, 'd'},
{"add-underscore", no_argument, NULL, 'U'},
+ {"add-stdcall-underscore", no_argument, NULL, OPTION_ADD_STDCALL_UNDERSCORE},
{"kill-at", no_argument, NULL, 'k'},
{"add-stdcall-alias", no_argument, NULL, 'A'},
{"ext-prefix-alias", required_argument, NULL, 'p'},
@@ -3150,6 +3156,9 @@ main (int ac, char **av)
case OPTION_NO_DEFAULT_EXCLUDES:
do_default_excludes = FALSE;
break;
+ case OPTION_ADD_STDCALL_UNDERSCORE:
+ add_stdcall_underscore = 1;
+ break;
case 'x':
no_idata4 = 1;
break;