This is the mail archive of the
mailing list for the GCC project.
Re: Call GNU ld with -O*
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Jul 2013 22:12:59 +0200 (CEST)
- Subject: Re: Call GNU ld with -O*
- References: <alpine dot DEB dot 2 dot 02 dot 1307121633360 dot 28978 at stedding dot saclay dot inria dot fr> <CAKOQZ8z0Nj2pjOiHQujr1XRw1e=9ynrMagyBayg_=Z3iO0VQUg at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1307122018190 dot 7127 at stedding dot saclay dot inria dot fr> <CAKOQZ8yQBzDFU0wqu+NpdV-hGtTaUix2JCon0f+ynUTxdmwZvw at mail dot gmail dot com> <20130712193050 dot GB2475 at laptop dot redhat dot com> <CAKOQZ8z=EULkpjCc2G1RgwW_V92YFsNBwQOXxpfttQi8gn+99Q at mail dot gmail dot com>
On Fri, 12 Jul 2013, Ian Lance Taylor wrote:
On Fri, Jul 12, 2013 at 12:30 PM, Jakub Jelinek <firstname.lastname@example.org> wrote:
On Fri, Jul 12, 2013 at 12:25:16PM -0700, Ian Lance Taylor wrote:
For gold I think it has two effects. If you use compressed debug
sections, it will compress them with zlib level 9 rather than 1. If
Marc's patch enabled it only for -O3/-Ofast (which are already compile time
expensive options, thus it perhaps it doesn't hurt that much to spend extra
time in the linker too) and -Os (then you are really looking for small,
and if ld -O2 provides that, then perhaps it is desirable too).
OK, let me put it this way: perhaps there is some set of linker
options that we should enable by default when linking with -O. But I
don't see any particular reason that they are specifically the linker
options that are selected by -O.
I completely agree with this. We could pass --compress-level=9
--merge-string-suffix --optimize-hashtables and a number of others (names
invented). -O2 just happens to include things (both for bfd and gold, but
the original motivation was bfd) that to me make sense to enable when
linking with gcc -O3 (highest level, not the day-to-day fast compilation).
If you think they don't, then let's reject this patch. Do you have any
suggestions for linker flags that we could pass for high optimization
levels where we don't mind if the linker takes a bit longer? (I guess that
if an option was suitable for gcc -O2, you might have made it the default
in the linker, hence my focus on -O3)