This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][rfc] Enabling more optimizations with -ON

On 19 November 2014 19:25, Cary Coutant <> wrote:
> Sorry, Rafael, I'm not ignoring your proposal -- I'm just pondering
> it. I'm not wild about the -O option in the first place, since it
> implies that we can nicely arrange the various optimizations into some
> order. Right now, we use it in exactly two places: -O1 with
> --compress-debug-sections uses ZIP compression level 9 instead of 1,
> and -O2 does tail optimization of the string tables. Both of those
> probably would have been cleaner with distinct options, but it was
> convenient and both simply trade a little link time for a smaller
> executable without any risk. It's not clear to me that --gc-sections
> or --icf are universally applicable, which is what bundling them with
> some optimization level would imply.

The issue then is that every software package has to test what liker
is being used to link it.

I got here by first modifying the clang build to pass --gc-sections
when linking clang. That found that older versions of bfd ld could not
handle --export-dynamic+gc-sections. I could (and if needed will)
write a check for "is this gold or a fixed bfd ld", but that need is
common to every project that wants gc-sections, so I tried to make
something more generic.

In the compiler land a project can just use -ON (module bugs) instead
of "-fopt1 -fopt2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]