4 ms·
This is a wonderful paper that includes many optimization tricks that are generally applicable, including various optimizations that they retrofitted into lld.
by omoikane 1mo ago
This is a wonderful paper that includes many optimization tricks that are generally applicable, including various optimizations that they retrofitted into lld. But I thought there was one meta optimization that was especially interesting (from page 2):
> A new linker's early adopters knowingly accept such differences, which is one reason why drastic improvements tend to come from new linkers rather than existing ones
This is true of many things, not just linkers. I think this is encouraging for people to (re)try things that have already been done, because newcomers are allowed to take risks that established things can't take.
- matheusmoreira 1mo agoMold's definitely innovating. I use mold a lot for code embedding in my lisp. I needed extra null PHT entries in the ELF so I could easily patch in custom segments into the interpreter after the link was done. GNU pretty much ignored the feature request and LLVM probably never even saw the issue, but Rui shipped the --spare-program-headers feature pretty much immediately after I requested it and it immediately restored my sanity. https://www.matheusmoreira.com/articles/self-contained-lone-lisp-applications https://www.matheusmoreira.com/articles/self-contained-lone-... Current version of my patcher supports ld and lld, but it has to move the PHT to the end of the file in order to append the new segments. Mold is still the only way to avoid the ugly hole where the PHT used to be.
- inigyou 1mo agoFYI you aren't supposed to use an OS-specific header type, since you aren't the OS. No one can stop you, of course, and since there isn't an application-reserved range, you had to pick someone's reserved range.
- matheusmoreira 1mo ago> since you aren't the OS Says who? You make it sound like there's some authority out there assigning these numbers. It's not like GNU had to go out there and beg them for it. They just did it, and the world just had to cope. Also, I'm building lone directly on top of the Linux kernel. That absolutely makes me the "operating system", in the GNU and POSIX sense. Lone/Linux, if you will. The idea is to take this far enough to boot Linux into a custom lisp userspace.
- inigyou 1mo ago[dead]