<div dir="ltr">Going a few more layers down the rabbit hole, it looks like this is the call chain<div><br></div><div>C:\llvm\lib\ExecutionEngine\RuntimeDyld\RTDyldMemoryManager.cpp<br></div><div><div><br></div><div>uint64_t</div><div>RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {</div></div><div>...</div><div><div>  return (uint64_t)sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);</div></div><div><br></div><div>C:\llvm\lib\Support\DynamicLibrary.cpp<br></div><div><div><br></div><div>#include "Windows/DynamicLibrary.inc"</div></div><div><br></div><div>C:\llvm\lib\Support\Windows\DynamicLibrary.inc<br></div><div><div><br></div><div>void *DynamicLibrary::getAddressOfSymbol(const char *symbolName) {</div></div><div>...</div><div><div>  if (Data == &OpenedHandles)</div><div>    return SearchForAddressOfSymbol(symbolName);</div><div>  return (void *)(intptr_t)GetProcAddress((HMODULE)Data, symbolName);</div></div><div><br></div><div><div>void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {</div></div><div>...</div><div><div>  return 0;</div></div><div><br></div><div>but wait, getAddressOfSymbol was never called. The call skipped that function - which presumably would have done the job - and hopped directly to SearchForAddressOfSymbol, which only checked OpenedHandles, and didn't do a straight check on the current process? Am I reading this correctly?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 2, 2016 at 8:23 AM, Russell Wallace <span dir="ltr"><<a href="mailto:russell.wallace@gmail.com" target="_blank">russell.wallace@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I've finally managed to extract from Kaleidoscope one particular thing that it seems to me should be working and isn't. Given the global declaration<div><br></div><div><div>extern "C" void foo() {}</div></div><div><br></div><div>within the same program I have</div><div><br></div><div>RTDyldMemoryManager::getSymbolAddressInProcess("foo")<br></div><div><br></div><div>And it's returning null. (LLVM 3.8, Windows 7 x64.) What am I missing?</div></div>
</blockquote></div><br></div>