This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Code Optimization


On Oct  7, 2002, Taha Mannan Jiruwala <taha@sasken.com> wrote:

> I think I have not put my problem statement clearly

In fact, you haven't even mentioned which architecture you're
targeting.  This can make a lot of difference as to the set of options
available.

> - Find a shared library solution that is efficient (Does not drastically
> reduce performance, may be something Intermediate to shared and static
> approach)

You may try to create dynamic libraries out of non-PIC.  Assuming this
is an IA32 architecture (in which -fPIC makes a lot of difference
given how register-starved it is), it can help speed up the
application code, at the expense of a lot of additional run-time
relocations, that will impact library load time.

Unfortunately, if you care about portability across multiple targets,
then creating dynamic libraries out of non-PIC is not an option.

You may consider using symbols of hidden visibility within the shared
library, such that function calls don't have to go through a PLT.
This may save space (for relocations), time (for relocations and
function calls).

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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