tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Trivial program size inflation

On Sun, Jul 02, 2023 at 05:04:10PM +0200, Martin Husemann wrote:
> The other things that we *might* look into (if someone volunteers) is to
> better modularize the CSU code, but it is not immediately clear how
> that could/should be done.

The CSU code has pretty much no idea on what the rest of the world is
going to do. It does:
- support self-relocation for PIE on supported archs
- set up profiling
- handle ifunc support on supported architectures
- support global destructors via atexit
- call the libc init
  - SSP init
  - setup atomic emulation
  - setup TLS on supported architectures
  - initialize pthread (emulation)
  - initialize environment

There is no way with ELF to decide at link time which of those features
are used by the program and therefore no way to remove any of them. If
you care about static executable size enough and for some reason have
programs that don't use stdio, you might get away by replacing jemalloc
with either the older version (HAVE_JEMALLOC=100) or not all
(USE_JEMALLOC=no). Personally I consider that navel gazing as few
programs actually qualify for that.


Home | Main Index | Thread Index | Old Index