Re:Dynamic linking
by cosmojg on Friday June 26, 2020 @11:44PM
(#23659366)
So let's fix the problem! How can we get better semantics? Have any hypothetical solutions in mind?
[ Parent
| on HN ]
Re:Dynamic linking
by cryptonector on Saturday June 27, 2020 @12:56AM
(#23659611)
I've outlined it already, but let me do it again for you:
1) when making a static link archive (a .a file), include a .o with a static symbol(s) whose values(s) records the metadata that ELF would have recorded, which here is: a) dependencies, b) how to find them, c) the mapfile / version-script (at least which symbols are symbolic, protected, or demoted to local, and which, if any, are interposers.
2) on final link-edits only the direct dependency -lfoo arguments should be needed, and then link-editor should find the dependencies' dependencies... by looking at the metadata recorded in the .a files.
Really, it's very simple. libstool is a very bad attempt at layering this on top of the linker (recording metadata in .la files), but it doesn't work well. This functionality has to be in the linkers.