Linkers are very much like hyperdrives. They're one of those ancient but ubiquitous technologies; no one knows how they work, but no one cares.
The basics of dynamic linking is actually pretty simple, but it's tricky to find reference materials outside of reading the source code itself. A modern, mature dynamic linker supports a lot of very interesting and very powerful features, from LD_PRELOAD to LD_AUDIT to `dlmopen` (linker namespaces.)
I wonder whether this new linker plans to support all of these advanced features.
I've spent some time with these features to accomplish tasks such as:
I think the LD_AUDIT approach taken by the latter project could also lead to re-implementing a dynamic linker in Python itself via the system's linker's auditing mechanism. This might be a very interesting educational exercise!
LD_PRELOAD and LD_AUDIT are the features of the dynamic linker or ld.so. The dynamic linker is a process to read an executable and DSOs in memory, fix up images in memory to make it really ready to be executed by a CPU. lld is a linker which creates executable or DSO files. That is different from the dynamic linker.
This may be a reference to a SciFi trope where a space faring society has use of hyperdrive technology that it bought/stole/inherited from an older civilization, but doesn't have any ability to create and/repair
The basics of dynamic linking is actually pretty simple, but it's tricky to find reference materials outside of reading the source code itself. A modern, mature dynamic linker supports a lot of very interesting and very powerful features, from LD_PRELOAD to LD_AUDIT to `dlmopen` (linker namespaces.)
I wonder whether this new linker plans to support all of these advanced features.
I've spent some time with these features to accomplish tasks such as:
- embedding Python interpreters within themselves using `dlmopen` (linker namespaces): https://gist.github.com/dutc/cf808ec7d8e1c36e01cc https://gist.github.com/dutc/423d0d0ccba771cf910f https://gist.github.com/dutc/eba9b2f7980f400f6287 https://gist.github.com/dutc/2866d969d5e9209d501a
- writing LD_PRELOAD-like modules in Python: https://gist.github.com/dutc/6500c804b2f0141c9757
I think the LD_AUDIT approach taken by the latter project could also lead to re-implementing a dynamic linker in Python itself via the system's linker's auditing mechanism. This might be a very interesting educational exercise!