public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Shared libraries: Avoiding lazy procedure linkage
@ 2004-11-16 12:20 Tushar
  2004-11-16 12:44 ` Ramana Radhakrishnan
  0 siblings, 1 reply; 2+ messages in thread
From: Tushar @ 2004-11-16 12:20 UTC (permalink / raw)
  To: gcc-help

Hello,

I've used gcc 3.4.1 and gcc 2.95.3 (This is actually
arm-linux-gcc)for creating shared libraries. There is
a difference in the way these two tool chains generate
libraries. 
In case of 3.4.1 the generated code uses lazy
proceprocedure linkage (uses .plt .got route ) in
shared libraries. In case of 2.95.3..... it doesnt do
this. The compilation/linking options remaining the
same.
 
My question is...if  its possible to avoid this lazy
procedure linkage in case of 3.4.1 using some command
line option. (which is seemingly default in 2.95.3)
 
thanx
Tushar



		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 

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

* Re: Shared libraries: Avoiding lazy procedure linkage
  2004-11-16 12:20 Shared libraries: Avoiding lazy procedure linkage Tushar
@ 2004-11-16 12:44 ` Ramana Radhakrishnan
  0 siblings, 0 replies; 2+ messages in thread
From: Ramana Radhakrishnan @ 2004-11-16 12:44 UTC (permalink / raw)
  To: Tushar; +Cc: gcc-help

Tushar wrote:
> Hello,
> 
> I've used gcc 3.4.1 and gcc 2.95.3 (This is actually
> arm-linux-gcc)for creating shared libraries. There is
> a difference in the way these two tool chains generate
> libraries. 
> In case of 3.4.1 the generated code uses lazy
> proceprocedure linkage (uses .plt .got route ) in
> shared libraries. In case of 2.95.3..... it doesnt do
> this. The compilation/linking options remaining the
> same.


Whether you are using 2.95 or 3.4.1, dynamic linking would always 
require the use of the PLT and the GOT on ELF / GNU Linux systems.

Lazy dynamic linking has nothing to do with the versions you are using. 
Lazy dynamic linking is actually a job of the dynamic linker / loader 
(ld-linux.so.2 usually on linux systems) and is controlled by the 
environment variable LD_BIND_NOW or the linker option -z now. This can 
be passed to the linker using the -Wl option with gcc. Lazy dynamic 
linking controls whether resolution of function references need to be 
done at load time or lazily whenever the function is referenced.

>  
> My question is...if  its possible to avoid this lazy
> procedure linkage in case of 3.4.1 using some command
> line option. (which is seemingly default in 2.95.3)

You might like to read Chapters 8-10 in the book by John Levine on 
Linkers and Loaders where he explains how the PLT and the GOT work . You 
might also like to read Ulrich Dreppers paper on how shared libraries 
work at : http://people.redhat.com/drepper/dsohowto.pdf



cheers
Ramana

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

end of thread, other threads:[~2004-11-16 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-16 12:20 Shared libraries: Avoiding lazy procedure linkage Tushar
2004-11-16 12:44 ` Ramana Radhakrishnan

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