Altera Nios II User Manual page 177

Hide thumbs Also See for Nios II:
Table of Contents

Advertisement

Chapter 7: Application Binary Interface
ABI for Linux Systems
In shared objects, the call and jmpi instructions can not be used because the library
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
%call, and the link editor may arrange for such entries to be lazily bound. Because
PLT entries are only used for lazy binding, shared object PLTs are smaller, as shown in
Example
Example 7–21. Shared Object PLT
.PLTn:
orhi
addi
br
Example 7–22
Example 7–22. Initial PLT Entry
.PLTresolve:
nextpc r14
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 in
Example 7–23. Initial PLT Entry Out of Range
.PLTn:
orhi
addi
nextpc r14
orhi
add
ldw
ldw
jmp
Linux Program Interpreter
The program interpreter is /lib/ld.so.1.
Linux Initialization and Termination Functions
The implementation is responsible for calling DT_INIT(), DT_INIT_ARRAY(),
DT_PREINIT_ARRAY(), DT_FINI(), and DT_FINI_ARRAY().
February 2014 Altera Corporation
7–21.
r15, r0, %hiadj(index * 4)
r15, r15, %lo(index * 4)
.PLTresolve
shows the initial PLT entry.
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)
r13, r0, %hiadj(_GLOBAL_OFFSET_TABLE_)
r13, r13, r14
r14, %lo(_GLOBAL_OFFSET_TABLE_+4)(r13)
r13, %lo(_GLOBAL_OFFSET_TABLE_+8)(r13)
r13
Example
7–23.
Nios II Processor Reference Handbook
7–19

Advertisement

Table of Contents
loading

Table of Contents