https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66305
--- Comment #4 from andi at firstfloor dot org --- > --- Comment #3 from lunar at debian dot org --- > Richard Biener: > > I think they become deterministic with -frandom-seed=0 for example. > > They are not deterministic to support partial linking of LTO objects as far > > as I know. > > They are indeed reproducible with `-frandom-seed=0`. But I guess there's a > downside to that, right? The downside is that incremential linking (ld -r) does not work. But the random seed is used for other things in gcc too, so you may have other problems too. > > similar, which would be a bit more deterministic, but there are still > > ways this could break (e.g. if someone copies object files around) > > Would using a hash over the section content work? In any cases, in the context > of Debian (this applies for FreeBSD as well), we have a canonical build path > so it would probably be fine to use it as the source of the hash. > > I guess one could already do this without further help by giving the > build path to `-frandom-seed=`. This only would need some Makefile trickery. Yes. It would probably be easier in gcc, e.g. with a new option.