public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Usage of the "-O" flag to ld
@ 2006-07-09 13:25 Erik Leunissen
  2006-07-09 19:10 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Erik Leunissen @ 2006-07-09 13:25 UTC (permalink / raw)
  To: binutils

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)?


Thanks for any help/pointers,

Erik Leunissen

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Usage of the "-O" flag to ld
  2006-07-09 13:25 Usage of the "-O" flag to ld Erik Leunissen
@ 2006-07-09 19:10 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2006-07-09 19:10 UTC (permalink / raw)
  To: Erik Leunissen; +Cc: binutils

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-09 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-09 13:25 Usage of the "-O" flag to ld Erik Leunissen
2006-07-09 19:10 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).