Hacker News new | ask | show | jobs
by janci 1808 days ago
How this compares to Windows? IIRC it is all handled by the executable itself? The kernel32.dll is loaded at known address and it has LoadLibrary function to get a handle of DLL and GetProcAddress that resolves a function name to a function pointer. It loads DLLs from the working directory or system directories. No versioning. (But there are some compatibility tricks to provide correct version of the library even when the dll name does not change)
2 comments

First of all it depends if it is a old style DLLs, or one that contains COM, as COM adds more execution models.

Additionally, applications can be packaged as DLLs and executed with help of rundll, after being loaded.

Manifests that control the loading process, besides the default way have been added in XP,

https://docs.microsoft.com/en-us/windows/win32/sbscs/applica...

Versioning in DLLs have been sorted out with SxS manifests, also in XP,

https://docs.microsoft.com/en-us/windows/win32/sbscs/isolate...

Previously versioning was sorted with VERSION resource scripts and expecting that developers actually cared about them, which most did not, hence the way .NET does versioning, and the latter improvements with manifest files for the dynamic linker.

https://docs.microsoft.com/en-us/windows/win32/menurc/using-...

I thought it was handled by ntdll.dll at the end of the day with the Ldr* set of functions. LoadLibrary ends up calling into that, but initial process load calls Ldr* without a LoadLibrary call.