This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Questions regarding m68k dynamic/shared code
Andreas Schwab <schwab@suse.de> writes:
> 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.
Yes, the approach used on most processors avoids self-modifying code
one way or another. When I said that the PLT is changed, I didn't
mean that the actual code is changed; just that the table information
is changed.
Ian