From Gentoo Wiki
Jump to:navigation Jump to:search
This is a Talk page - please see the documentation about using talk pages. Add newer comments below older ones, sign comments using four tildes (~~~~), and indent successive comments with colons (:). Add new sections at the bottom of the page, under a heading (== ==). Please remember to mark sections as "open for discussion" using {{talk|open}}, so they will show up in the list of open discussions.


Talk status
This discussion is still ongoing.

As far as I'm aware, the Gold linker's development has stagnated. Fedora is debating kicking it out of the binutils package, it has worse success for linking object files and is no longer relevant for LTO since BFD now supports plugins. Clang is better off with LLD or can fall back to BFD, even with LTO. Do we need to point people to a dying linker? --Unhappy-Ending (talk) 08:33, 10 March 2022 (UTC)

I agree that there is no point thinking about ever using Gold, but I don't think that the link is particularly harmful. --Matthews (talk) 08:45, 10 March 2022 (UTC)


Talk status
This discussion is still ongoing.

We should also try not to hype up the speed too much, as mold is still in early development and as optimizations (maybe) get added will slow link time down. For example, mold ignores -Wl,-O1 which would add link time during the link phase. LLD for example, uses the -Wl,-O2 flag to use zlib compression to create smaller code which adds time during the link phase. --lto-O3 was just added to mold as well, which adds additional link time using more aggressive LTO passes if it's similar to LLD in behavior. --Unhappy-Ending (talk) 08:40, 10 March 2022 (UTC)

I don't think there's much reason to use mold with LTO. Actually linking ends up being a small part of the time spent when LTO is enabled[1].
If GCC users are looking for a speedy linker that hasn't been abandoned with LTO support, mold would be have to be it. GCC can use LLD, but only for non-LTO linking. LLD will provide a nice speedup and also offers --icf=all/safe/none options. With mold, GCC users would get --icf and LTO, so that would be something worth looking into.--Unhappy-Ending (talk) 09:01, 10 March 2022 (UTC)

Address randomization

Talk status
This discussion is still ongoing.

mold recently gained the --shuffle-sections option to randomly shuffle input sections before writing them to an output file. With this option, we can create a stronger form of address randomization. That is, even if you built the same executable in the same way for two Gentoo machines, they'll have the executables that behave the same but with different memory layouts. Are you guys interested in supporting this? --Ruiu (talk) 06:39, 10 May 2022 (UTC)