Intel NIOS II Owner Reference Manual page 166

Table of Contents

Advertisement

performance. The link editor arranges for the Nth PLT entry to point to the Nth branch;
res_N
corresponding R_JUMP_SLOT relocation.
The dynamic linker initializes GOT[1] to a unique identifier for each library and GOT[2]
to the address of the runtime resolver routine. In order for the two loads
in
.PLTresolve
aligned to a 16-byte boundary.
The runtime resolver receives the original function arguments in
shared library identifier from GOT[1] in
. The resolver updates the corresponding PLT GOT entry so that the PLT entry
r15
transfers control directly to the target in the future, and then transfers control to the
target.
In shared objects, the
load address is not known at link time. Calls to functions outside the current shared
object must pass through the GOT. The program loads function addresses using
, and the link editor may arrange for such entries to be lazily bound. Because
%call
PLT entries are only used for lazy binding, shared object PLTs are smaller, as shown
below.
Example 27. Shared Object PLT
.PLTn:
orhi
addi
br
Example 28. Initial PLT Entry
.PLTresolve:
nextpc
orhi
add
ldw
ldw
jmp
If the initial PLT entry is out of range, the resolver can be inline, because it is only one
instruction longer than a long branch, as shown below.
Example 29. Initial PLT Entry Out of Range
.PLTn:
orhi
addi
nextpc
orhi
add
ldw
ldw
jmp
7.9.6.4. Linux Program Interpreter
The program interpreter is /lib/ld.so.1.
Nios II Processor Reference Guide
166
is four times the index into the
res_0
to share the same
and
call
r15, r0, %hiadj(index * 4)
r15, r15, %lo(index * 4)
.PLTresolve
r14
r13, r0, %hiadj(_GLOBAL_OFFSET_TABLE_)
r13, r13, r14
r14, %lo(_GLOBAL_OFFSET_TABLE_+4)(r13)
r13, %lo(_GLOBAL_OFFSET_TABLE_+8)(r13)
r13
r15, r0, %hiadj(index * 4)
r15, r15, %lo(index * 4)
r14
r13, r0, %hiadj(_GLOBAL_OFFSET_TABLE_)
r13, r13, r14
r14, %lo(_GLOBAL_OFFSET_TABLE_+4)(r13)
r13, %lo(_GLOBAL_OFFSET_TABLE_+8)(r13)
r13
.rela.plt
,
%hiadj
_GLOBAL_OFFSET_TABLE_
, and the relocation index times four in
r14
instructions can not be used because the library
jmpi
7. Application Binary Interface
NII-PRG | 2018.04.18
section for the
must be
through
, the
r4
r7

Advertisement

Table of Contents
loading

Table of Contents