Re: -ffunction-sections, -fdata-sections and -Wl,--gc-sections

From: Tim Kientzle <kientzle_at_freebsd.org>
Date: Sun, 15 Sep 2013 19:30:01 -0700
On Sep 15, 2013, at 2:24 PM, Ed Schouten <ed_at_80386.nl> wrote:
> GCC and Clang support the -ffunction-sections and -fdata-sections
> flags. Essentially, these flags force the compiler to put every
> function and variable in its own section. Though this will blow up the
….
> - devd suddenly becomes 500 KB in size, instead of a megabyte,
> - init's size drops from 900 KB to 600 KB,

Can you figure out what functions are getting omitted
when you make this change?

Can you extract a linkage map from a build done this
way and compare it to one done the regular way?

That big of a difference suggests we have some badly-factored
code in our libraries.  That is, some library is putting functions
into a single source file that shouldn't be combined.

Tim
Received on Mon Sep 16 2013 - 00:30:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:41 UTC