title: Have dll import symbols from its calling .exe
body: <p>Related to but not equivalent to <a href="https://stackoverflow.com/questions/3752634/dll-get-symbols-from-its-parent-loader">DLL Get Symbols From Its Parent (Loader)</a></p>
  
  <p>Is there a way to convince the Windows loader to resolve a particular symbol referenced by A.dll from either the loading executable or an intermediate dll without specifying the file to resolve symbols from in A.dll?</p>
  
  <p>It's pretty obvious how to do it if the loading .exe has a known name, but if it isn't ...</p>
  
  <p>Here's a good reason why you'd actually want to do this: <a href="https://www.gnu.org/software/libc/manual/html_node/Replacing-malloc.html" rel="nofollow noreferrer">https://www.gnu.org/software/libc/manual/html_node/Replacing-malloc.html</a></p>
  
  <p>If this can be done, a good answer would say how to do it some way or another.</p>
  
  <p>I'm half-expecting the answer is it can't be done. In that case, a good answer would show why this is impossible. "The build tools don't support this." is a bad answer.</p>