This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Questions regarding m68k dynamic/shared code
- From: Andreas Schwab <schwab at suse dot de>
- To: binutils at sources dot redhat dot com
- Cc: gcc at gcc dot gnu dot org, libc-alpha at sources dot redhat dot com,pbarada at mail dot wm dot sps dot mot dot com
- Date: Thu, 09 Jan 2003 14:05:06 +0100
- Subject: Re: Questions regarding m68k dynamic/shared code
- References: <200301081803.h08I3vV19219@hyper.wm.sps.mot.com><m3iswzwli4.fsf@gossamer.airs.com>
Ian Lance Taylor <ian@airs.com> writes:
|> > 3) What *does* the code in the .plt seciton actually do?
|>
|> The Procedure Linkage Table is used to support shared libraries. When
|> code calls a function which is defined in a shared library, that call
|> goes through the PLT. The PLT encodes the information required to
|> find the function in the shared library, and calls code in the dynamic
|> linker (ld.so) to locate that function and call it. Normally the
|> actual lookup only happens the first time; after that, the PLT is
|> changed to jump directly to the appropriate code for all subsequent
|> calls.
On m68k the PLT is doing an indirect jump through the corresponding GOT
entry, and only the GOT entry is adjusted by the dynamic linker. This
avoids all the complications of self-modifying code.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."