I found this old email from Greg online: 
http://comments.gmane.org/gmane.comp.debugging.lldb.devel/305
His claim is that without RTLD_FIRST:

> FileSpec plugin_spec ("/plugins/disassembler.dylib");
> void *lib_handle = Host::DynamicLibraryOpen (plugin_spec, error);
> if (lib_handle)
> {
>     void *init_callback = Host::DynamicLibraryGetSymbol (lib_handle, 
> "InitPlugin", error);
>     if (init_callback)
>     {
>         // Now on linux we might have a function that comes from another 
> shared library...
>     }
> }
The documentation is indeed fairly scarce on the subject of how things might go 
wrong without the flag.. but the description seems compelling enough that I’d 
like to keep it..


> On Aug 21, 2014, at 3:31 PM, Zachary Turner <[email protected]> wrote:
> 
> Can someone explain this flag to me?  I've read the documentation, but it's 
> still not clear to me.  If you ask dlsym() to search some module X, why would 
> it ever search modules other than X?
> 
> The reason I ask about this is that llvm support library already has a 
> DynamicLibrary class whose purpose almost exactly matches what we're using 
> the Host::DynamicLibrary related functions for.  However, it doesn't use the 
> RTLD_FIRST flag, and so I'm not sure what the implications are of us using it 
> and deleting our own DynamicLibrary code.
> _______________________________________________
> lldb-dev mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Thanks,
- Enrico
📩 egranata@.com ☎️ 27683




_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to