libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static lib with libtool 1.5


From: Ralf Wildenhues
Subject: Re: static lib with libtool 1.5
Date: Thu, 11 Aug 2005 16:41:46 +0200
User-agent: Mutt/1.4.1i

* Jeremie LE HEN wrote on Thu, Aug 11, 2005 at 04:10:41PM CEST:
> Hi Patrick,
> 
> > quartz% diff -s foo.o .libs/foo.o
> > Files foo.o and .libs/foo.o are identical

Another hint: try
---snip
int foo() { return 1; }
int bar() { return foo(); }
---snip

> I'm not a compiler guru, but as far as I can tell cutting-edge Unices
> like Linux and *BSD used to always build PIC objects, little does it
> matter you asked for it or not.

This is not correct.

However:  For example, it is correct that GNU/Linux on _some_ systems
(e.g.: x86 but not x86_64) allows to put text relocations into shared
objects.  The tradeoff of non-shareable segments in shared libraries
are a little higher execution speed vs much higher memory usage.  (The
extent of "little" and "much" in this context are very much dependent
on the specific code and usage pattern.)

In general, non-PIC code can not be put into shared objects.

> Object files compiled with -fPIC have
> however some additional symbols such as ``_GLOBAL_OFFSET_TABLE_''.

They also have position-independent relocations.
Try 'objdump -x' on my above example.

Regards,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]