Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 23 Oct 2015 15:12:02 +0200
From: Szabolcs Nagy <>
Cc: Rich Felker <>,
	Denys Vlasenko <>
Subject: Re: [PATCH] configure: add gcc flags for better link-time

* Denys Vlasenko <> [2015-10-23 14:30:26 +0200]:
> size reduction:
>    text	   data	    bss	    dec	    hex	filename
>  564099	   1944	  11768	 577811	  8d113
>  562277	   1924	  11576	 575777	  8c921

i assume this is x86_64, nice improvement.

> +# When linker merges sections, a tiny section (such as one resulting
> +# from "static char flag_var") with no alignment restrictions
> +# can end up logded between two more strongly aligned ones (say,
> +# "static int global_cnt1/2", both of which want 32-bit alignment).
> +# Then this byte-sized "flag_var" gets 3 bytes of padding.
> +#
> +# With section sorting by alignment, one-byte flag variables have
> +# higher chance of being grouped together and not require padding.
> +# (It can be made even better. Linker is too dumb.
> +# ld needs to grow -Wl,--pack-sections-optimally)
> +#
> +# For us, this affects the size of only one file:
> +#
> +tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment
> +tryldflag LDFLAGS_AUTO -Wl,--sort-common

i think this came up before

it was also noted at some point that the optimal sorting
is 'sort by use' so all the unused legacy functions end
up on the same page so they never need to be loaded.

probably config knobs would be useful that turn off libc
features, but not by dropping them, just moving them to a
different part of that is assumed to be never needed.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.