Hacker News new | ask | show | jobs
by vtsingaras 3291 days ago
```within a compilation unit```

It's the compiler that needs to do the job.

1 comments

I think both can do it.

The compiler can do it within the compilation unit, randomizing the order of the blocks and globals.

The basic linker just quickly concatenates compilation units, but randomizes the order that it concatenates the units and randomizing the GOT and PLT order.

A link-time-optimizing linker can actually randomize the order of the blocks and globals and the compiler wouldn't need to be involved.

On the Mill CPU project we plan to randomize the order of everything each time we 'specialize'; kernels and user-space will have randomized GOT and block order on every installation, and it also helps smoke out bugs :)