Is there an open source equivalent of Linux' /lib/ld-linux.so for Windows?
Asked Answered
M

4

5

Is there an open source program for Windows that offers the same functionality as Linux' /lib/ld‑linux.so.2?

Metamerism answered 17/8, 2011 at 14:42 Comment(2)
What are you going to use it for?Wooded
@karlphillip: I want to extend the dynamic linking process using information in custom PE sections.Metamerism
J
4

The loader is a core part of the OS on Windows; there's no open-source alternative I'm aware of, and I'm not sure it'd be possible to do it correctly in any case - you have to handle the minefield of assumptions that kernel32/ntdll have regarding address space layout, support SxS, ASLR, hotpatching, and more.

Open-source linkers are common (e.g., gnu tools), but I gather that's not what you're after.

Jarnagin answered 25/8, 2011 at 15:5 Comment(0)
D
4

You might want to look at the ReactOS project.

They should have everything to load DLLs, and it is open-source.

Diabolo answered 26/8, 2011 at 7:41 Comment(0)
B
2

The Enhanced Dynamic Linking Library for MinGW under MS-Windows may be helpful. Take a look especially at the bottom for the edll solution.

Brahman answered 25/8, 2011 at 20:27 Comment(0)
W
0

You mean using dynamic libraries? In Windows that's automatic when you use LoadLibrary on a .DLL.

Whimsy answered 17/8, 2011 at 14:46 Comment(3)
Right. I know that Windows dynamically links binaries when they are executed (or loaded in the case of LoadLibrary), but I would like to know if there is an open source dynamic linker for Windows, one that I could modify.Metamerism
You want to merge DLL's into the parent executables? That won't work in the general case because DLL's are executables (or more correctly, EXE's are DLL's). They have large overlapping portions that would get overwritten.Whimsy
Once you start making assumptions about the DLL's contents however, there are alternatives. The biggest one is probably ilmerge.exe for the .NET framework-generated .DLL's.Whimsy

© 2022 - 2024 — McMap. All rights reserved.