This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dlls @n symbols


Emanuele ALIBERTI <ealiberti@hotmail.com> writes:
> > > The goal for me is:
> > > 1. NOT having mangled names in the exports table
> > > 2. having an import library which lets ld lookup mangled names
> > > 3. having finally an application that imports UNmangled names
> > >
> > > I succeeded only with step 1.
> >
> >I don't understand (2) and (3). Could you please elaborate, with examples,
> >and then we can discuss if they're feasible or not. If these steps are
> >not possible with MSVC or Borland, chances are it won't be easily doable
> >or practical in GNU tools either.
> 
> Here is a full not working example. Perhaps I use dlltool the wrong way. (2) 
> is: test.a seems not having symbols for Foo@0 and Bar@24. If I uncomment 
> mangled names in the DEF file, they get defined, but appear also in the 
> DLL's exports table. (3) is: if I define the mangled names in the DEF, then 
> ld creates the application, but its imports table contains mangled names, 
> not clean names, so having a clean exports table in the DLL is useless!

Again, I'm unsure as to what you're trying to achieve here. If you tell 
the import library NOT to have mangled names, your client code won't link.
That's how things work (and so does MSVC, which is the native reference
implementation on windows32).

The reason to have "clean" names in the export list is simple -- so you
can use LoadLibrary. If you only need to use LoadLibrary, then you can
use the clean names. So have both in the export list! What's the big deal?

One way to achieve both is the following (and that's how MSVC developers
do this in case you're interested): Have two different export def files,
one for creating the DLL, and the other for creating the import library.
When creating the DLL, use the aliasing mechanism to get only clean names;
when creating the import library, using Foo@<n> etc and use -k to have
@<n> linkable symbols that point to export symbol without the @<n>, ie.,
the "clean" names.

Let me ask the same question I had the last time -- can you do what you
want with MSVC? If so, how?

If you feel like it's not doing the right thing, please feel free to 
start digging into binutils sources and see if you can help improve
it.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]