dlltool -N [PATCH]
Shaun Jackman
sjackman@gmail.com
Tue Sep 21 01:10:00 GMT 2004
This patch adds a switch to dlltool that prefixes global symbols of
the static interface library with underscores, but not the import
name. It's used to create stub static interface libraries for
pre-existing DLLs that do not use underscore prefixes. I'm not sure if
anyone else uses this functionality, but the patch is non-invasive.
Please cc me in your reply. Cheers,
Shaun
note: This is my first attempt at posting a patch with Gmail. If it
gets munged, I'll repost with a different MUA.
2004-09-20 Shaun Jackman <sjackman@debian.org>
* dlltool.c: Add -N switch which prefixes the global symbols with underscores
but not the import names.
--- dlltool.c.orig 2004-05-17 12:35:51.000000000 -0700
+++ dlltool.c 2004-09-20 17:58:18.000000000 -0700
@@ -375,6 +375,10 @@
compatibility to old Cygwin releases. */
static bfd_boolean create_compat_implib;
+/* Prepend underscore to global symbol, but not to the import name.
+ Needed for creating libs from def-files. */
+static bfd_boolean create_name_with_underscore = 0;
+
static char *def_file;
extern char * program_name;
@@ -2311,7 +2315,10 @@
if (! exp->data)
{
exp_label = bfd_make_empty_symbol (abfd);
- exp_label->name = make_imp_label ("", exp->name);
+ if (create_name_with_underscore)
+ exp_label->name = make_imp_label ("_", exp->name);
+ else
+ exp_label->name = make_imp_label ("", exp->name);
/* On PowerPC, the function name points to a descriptor in
the rdata section, the first element of which is a
@@ -3123,6 +3130,7 @@
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, _(" -N --iface-underscore Add underscores to
iface lib syms, not import names.\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, _(" -S --as <name> Use <name> for
assembler.\n"));
@@ -3202,7 +3210,7 @@
#ifdef DLLTOOL_MCORE_ELF
"m:e:l:aD:d:z:b:xcCuUkAS:f:nvVHhM:L:F:",
#else
- "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVHh",
+ "m:e:l:aD:d:z:b:xcCuUkAS:f:nvVHhN",
#endif
long_options, 0))
!= EOF)
@@ -3271,6 +3279,9 @@
case 'U':
add_underscore = 1;
break;
+ case 'N':
+ create_name_with_underscore = 1;
+ break;
case 'k':
killat = 1;
break;
More information about the Binutils
mailing list