Re: Pragma mangle and D shared objects

2014-11-06 Thread Etienne Cimon via Digitalmars-d-learn
On 2014-10-26 14:25, Etienne Cimon wrote: On 2014-10-25 23:31, H. S. Teoh via Digitalmars-d-learn wrote: Hmm. You can probably use __traits(getAllMembers...) to introspect a library module at compile-time and build a hash based on that, so that it's completely automated. If you have this availab

Re: Pragma mangle and D shared objects

2014-10-26 Thread Etienne Cimon via Digitalmars-d-learn
On 2014-10-25 23:31, H. S. Teoh via Digitalmars-d-learn wrote: Hmm. You can probably use __traits(getAllMembers...) to introspect a library module at compile-time and build a hash based on that, so that it's completely automated. If you have this available as a mixin, you could just mixin(exportL

Re: Pragma mangle and D shared objects

2014-10-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Oct 25, 2014 at 10:54:53PM -0400, Etienne Cimon via Digitalmars-d-learn wrote: > On 2014-10-25 21:26, H. S. Teoh via Digitalmars-d-learn wrote: > >Not sure what nm uses, but a lot of posix tools for manipulating > >object files are based on binutils, which understands the local > >system's

Re: Pragma mangle and D shared objects

2014-10-25 Thread Etienne Cimon via Digitalmars-d-learn
On 2014-10-25 21:26, H. S. Teoh via Digitalmars-d-learn wrote: Not sure what nm uses, but a lot of posix tools for manipulating object files are based on binutils, which understands the local system's object file format and deal directly with the binary representation. The problem is, I don't kno

Re: Pragma mangle and D shared objects

2014-10-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Oct 25, 2014 at 08:05:18PM +, John Colvin via Digitalmars-d-learn wrote: > On Saturday, 25 October 2014 at 18:40:23 UTC, H. S. Teoh via > Digitalmars-d-learn wrote: > >Actually, the object file (library) itself should already have a list > >of exported symbols; you could then use core.

Re: Pragma mangle and D shared objects

2014-10-25 Thread John Colvin via Digitalmars-d-learn
On Saturday, 25 October 2014 at 18:40:23 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Actually, the object file (library) itself should already have a list of exported symbols; you could then use core.demangle to extract the function signatures from the mangled symbols and construct a hash of

Re: Pragma mangle and D shared objects

2014-10-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Oct 25, 2014 at 12:15:19PM -0400, Etienne Cimon via Digitalmars-d-learn wrote: > On 2014-10-25 11:56, Etienne Cimon wrote: > >That looks like exactly the solution I need, very clever. It'll take > >some time to wrap my head around it :-P It's not that complicated, really. It's basically p

Re: Pragma mangle and D shared objects

2014-10-25 Thread Etienne Cimon via Digitalmars-d-learn
On 2014-10-25 11:56, Etienne Cimon wrote: That looks like exactly the solution I need, very clever. It'll take some time to wrap my head around it :-P Just brainstorming here, but I think every dynamic library should hold a utility container (hash map?) that searches for and returns the mangle

Re: Pragma mangle and D shared objects

2014-10-25 Thread Etienne Cimon via Digitalmars-d-learn
That looks like exactly the solution I need, very clever. It'll take some time to wrap my head around it :-P

Re: Pragma mangle and D shared objects

2014-10-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Oct 25, 2014 at 09:20:33AM -0400, Etienne Cimon via Digitalmars-d-learn wrote: > I haven't been able to find much about pragma mangle. I'd like to do > the following: > > http://forum.dlang.org/thread/hznsrmviciaeirqkj...@forum.dlang.org#post-zhxnqqubyudteycwudzz:40forum.dlang.org > > Th

Pragma mangle and D shared objects

2014-10-25 Thread Etienne Cimon via Digitalmars-d-learn
I haven't been able to find much about pragma mangle. I'd like to do the following: http://forum.dlang.org/thread/hznsrmviciaeirqkj...@forum.dlang.org#post-zhxnqqubyudteycwudzz:40forum.dlang.org The part I find ugly is this: void* vp = dlsym(lib, "_D6plugin11getInstanceFZC2bc2Bc\0".ptr); I wa