This is the mail archive of the
mailing list for the GCC project.
Re: Link-time optimzation
- From: Kean Johnston <jkj at sco dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Wed, 16 Nov 2005 18:39:31 -0800
- Subject: Re: Link-time optimzation
- References: <437BB214.email@example.com>
- Reply-to: jkj at sco dot com
The document is on the web here:
The LaTeX sources are in htdocs/projects/lto/*.tex.
It may be worth mentioning that this type of optimization
applies mainly to one given type of output: a non-symbolic
a.out. When the output it a shared library or an a.out with
exposed symbols (-Bexport, -E etc), then the semantics will
need to be different.
In the simplest case where you are producing a non-symbolic
a.out, you can detect that global functions or variables
are completely unused, and therefore discard them. However,
if the a.out has some of its symbols exposed by linker options,
then those symbols, and any other symbols or functions which
they reference, must be left intact. Similarly for shared
libraries, although that case is slightly worse as *any* global
symbol must be left intact, unless a specific export list
is being used, in which case only those symbols, and symbols
which they in turn reference, need survive.
At least thats my understanding.
Also, this whole issue of visible symbols and shared libraries
may well be covered by requirement 3, and if so, it may be
worth mentioning since there was no accompanying rationale
for requirement 3.