[llvm-dev] [cfe-dev] RFC: Linker feature for automatically partitioning a program into multiple binaries

Joerg Sonnenberger via llvm-dev
Wed, 27 Feb 2019 23:52:01 -0000

On Tue, Feb 26, 2019 at 11:37:16PM -0500, James Y Knight via cfe-dev
wrote:
> What I want is to be able to statically link _independent_ binaries (either
> executables or shared libraries), which happen to depend on a lot of the
> same code. And, then, to save space by reducing the amount of duplicated
> code between them.

crunchgen in NetBSD does essentially the first half. -ffunction-sections
could do a bit of the second part, but I'm not sure if you actually save
much.

Joerg