On Wed, 2002-02-20 at 16:41, Peter Naulls wrote:
> I'm after a quick run down of how the dynamic linking system works in
> ARM Linux, with particular interest to the register bindings and access
> to library constants etc.

There aren't really any register bindings of any great interest.  At one
level, dynamic objects are just regular binaries and the ABI is
identical.  In practice, dynamic libraries end up being compiled PIC,
especially if they are intended to be shared, and this brings the
requirement to hold a pointer to the GOT.  However, this doesn't change
anything from the outside -- R10 is normally used as the PIC register
but individual objects, or even individual functions within an object,
are entitled to choose a different register if they prefer.

In non-PIC code access to constants and other library data is done
exactly as normal.  In PIC code, pointers to data objects are relocated
either by indirecting through the GOT or by encoding the address as an
offset from the GOT itself.  Calls to functions in PIC code are
indirected through a PLT, each entry of which looks like this:

        ldr     ip, lab
        add     ip, pc, ip
        ldr     pc, [ip]
lab:    .word   (GOT_entry - lab)

Any help?

p.


_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
http://www.arm.linux.org.uk/armlinux/mailinglists.php
Please visit the above addresses for information on this list.

Reply via email to