lists.zerezo.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: [Mingw-users] createing a dll



Bob Rossi wrote:

> I want to make a dll that has unresolved symbols, and then load it at
> runtime with LoadLibrary and have the symbols be resolved then.
> 
> Is this possible? For some reason, I'm under the impression that all the
> symbols need to be resolved at dll creation time.

It's not possible to create a DLL with symbol references that are
unresolved (meaning unknown what module they reside in) at the time of
linking.  But what you're talking about isn't impossible, either.  When
creating the DLL you simply have to tell the linker the name of the
module from which each symbol will be imported, either through an import
library or a .def file.  That module can be the main .exe in the case of
a plugin.  That module need not exist yet at the time of linking.  This
has been discussed extensively in the past, e.g.
<http://thread.gmane.org/gmane.comp.gnu.mingw.user/17876/focus=17890>.

Please provide more details and preferrably a small testcase.

On a completely unrelated path, you can also try FlexDLL which
implements a method for doing the kind of ELF lazy binding that allows
symbols to remain undefined at link time and be resolved only at
runtime.  But this is not generic PE, it requires this special support
library be linked in.  It is quite clever how it twists PE though.

Brian

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users