This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Usage of the "-O" flag to ld
- From: Ian Lance Taylor <iant at google dot com>
- To: Erik Leunissen <e dot leunissen at hccnet dot nl>
- Cc: binutils at sourceware dot org
- Date: 09 Jul 2006 12:09:59 -0700
- Subject: Re: Usage of the "-O" flag to ld
- References: <44B103BB.3060906@hccnet.nl>
Erik Leunissen <e.leunissen@hccnet.nl> writes:
> What values are useful with the "-O" flag? The ld manual says that the
> number must be > 0. That leaves some room for variation ;-)
>
> But seriously, I tried -O99, which was taken without complaint by the
> linker and did not produce any errors at runtime. However, I'm
> confident that the sky is not the limit here, and that "99" and "98"
> probably are indiscriminate w.r.t. the effect they resort.
>
> A related question: is there any documentation that explains what kind
> of optimizations the linker performs (in contrast to optimizations
> performed by the compiler)?
As far as I know the only optimization implemented in the linker is to
optimize the hash table used for dynamically linked objects and shared
libraries in ELF. This is done at any level of -O.
Ian