If I had my way

Jacob Carlborg doob at me.com
Tue Dec 13 05:12:43 PST 2011


On 2011-12-13 13:12, Martin Nowak wrote:
> On Sat, 10 Dec 2011 22:32:17 +0100, Walter Bright
> <newshound2 at digitalmars.com> wrote:
>
>> On 12/10/2011 12:53 PM, maarten van damme wrote:
>>> Could also someone shed some light on creating shared library's on
>>> linux? there
>>> was some news about -fPIC beeing fixed but no real confirmation.
>>
>> Turns out there was a bug where EBX was not set correctly when calling
>> a function that existed in a shared library. This bug was fixed. So
>> we're ready to try again at creating a shared library with dmd.
>>
>
> On x86-64 the PIC code is working fine, but there were some relocation
> issues left.
> https://github.com/dawgfoto/dmd/commits/SharedElf
>
> I'm looking into wiring things up with the runtime,
> but it requires quite some changes.
>
> One thing I don't have a good answer too is how to handle registration
> of a shared library loaded during runtime. Apparently we don't want
> to synchronize all threads whenever a library gets loaded/unloaded.
>
> martin

On Mac OS X there's a function available for that, 
"_dyld_register_func_for_add_image". I don't know if there's something 
similar available on Linux and FreeBSD.

http://developer.apple.com/library/mac/#documentation/developertools/Reference/MachOReference/Reference/reference.html

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list