Reputation: 71
With Visual Studio under Windows, it is possible to delay load libraries and functions, with the linking flag "/DelayLoad somelib.lib", something provided by DelayImp.lib.
Under the hood, it seems that doing so tells the linker to wrap every referenced function of "somelib.lib" with the Win32 APIs LoadLibrary and GetProcAddress, which allows to resolve the functions at runtime.
I would need to accomplish the same with clang under Windows, but didn't manage to find any documentation on the subject.
It is possible to delay load libraries with clang / LLVM, and if so, how?
For the curious, this is part of an on-going project to port meterpreter's codebase to clang, which relies heavily on said delay loading offered by MSVC.
Upvotes: 2
Views: 547