<div dir="ltr">I actually already got the patch put together. I posted in another thread. I don't know how to test plugin code, so if you or someone else there is willing to help out and check that it works as expected, I would appreciate it.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 5:27 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sounds good to me. Hopefully if they don't want that they might accept an extra boolean argument that can specify to only look in the current shared library and then we can switch over to using LLVM's DynamicLibrary.<br>
<div class="HOEnZb"><div class="h5"><br>
> On Aug 21, 2014, at 4:22 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
><br>
> This seems like the only case we ever want, so I'm going to post a patch to LLVM's DynamicLibrary class to use RTLD_FIRST on Apple, and a similar method of checking the module filespec on other platforms, and see if they accept it. If so, I will convert our Plugin code to use LLVM's DynamicLibrary and then delete our DynamicLibrary<br>
><br>
><br>
> On Thu, Aug 21, 2014 at 4:08 PM, Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br>
><br>
> > On Aug 21, 2014, at 3:31 PM, Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br>
> ><br>
> > Can someone explain this flag to me?<br>
><br>
> It says "only look in this binary, don't look in any others. We are looking for a plug-in initialization function and we don't want to get one back from another dylib.<br>
><br>
> As Enrico said, the email from a while back details this:<br>
><br>
> <a href="http://comments.gmane.org/gmane.comp.debugging.lldb.devel/305" target="_blank">http://comments.gmane.org/gmane.comp.debugging.lldb.devel/305</a><br>
><br>
> > 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?<br>
><br>
> I don't know but it does.<br>
><br>
> ><br>
> > 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.<br>
><br>
> It would be nice if we could specify this flag so we either find the symbol from libx.dylib or we don't. We don't want to find the symbol in liby.dylib and call it in our case.<br>
><br>
<br>
</div></div></blockquote></div><br></div>