shared libs for OSX

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Sat May 23 12:20:56 PDT 2015


On 2015-05-22 03:13, bitwise wrote:

> So does that mean that "_dyld_register_func_for_add_image" shouldn't be
> called at all from shared libs at all then? The fact that there is no
> "unregister" function seems to suggest that it's meant to be called once
> from the main executable to add a callbacck that survives the entire
> life of the program.

Yes.

> Can't whatever the callback does be done from the
> runtime linked to the main executable?

The runtime extracts some data from the loaded image and stores it in 
some global variable. If the executable would do this it needs to store 
the data in the global variable in the dynamic library.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list