Dwarf-2 Definition; Object Files; Relocation - Altera Nios II User Manual

Hide thumbs Also See for Nios II:
Table of Contents

Advertisement

7–8
If the return type is larger than 8 bytes, the Nios II C/C++ compiler treats this
program as if a() had passed a pointer to b().
C/C++ compiler sees the code in
Example 7–3. Returned struct is Larger than 8 Bytes
void b(STRUCT *p_result, int i, int j)
{
}
void a(...)
{
}

DWARF-2 Definition

Registers r0 through r31 are assigned numbers 0 through 31 in all DWARF-2
debugging sections.

Object Files

Table 7–3. Nios II-Specific ELF Header Values
Member
e_ident[EI_CLASS]
e_ident[EI_DATA]
e_machine

Relocation

In a Nios II object file, each relocatable address reference possesses a relocation type.
The relocation type specifies how to calculate the relocated address. The bit mask
specifies where the address is found in the instruction.
Table 7–4. Nios II Relocation Calculation (Part 1 of 3)
Name
R_NIOS2_NONE
R_NIOS2_S16
R_NIOS2_U16
R_NIOS2_PCREL16
R_NIOS2_CALL26
R_NIOS2_IMM5
R_NIOS2_CACHE_OPX
Nios II Processor Reference Handbook
...
*p_result = result;
STRUCT value;
...
b(*value, i, j);
Overflow
Value
check
(1)
0
n/a
None
1
Yes
S + A
2
Yes
S + A
3
Yes
((S + A) – 4) – PC
4
No
(S + A) >> 2
5
Yes
(S + A) & 0x1F
6
Yes
(S + A) & 0x1F
Chapter 7: Application Binary Interface
Example 7–3
Example
7–2.
Value
ELFCLASS32
ELFDATA2LSB
EM_ALTERA_NIOS2 == 113
Relocated Address
R
(2)
DWARF-2 Definition
shows how the Nios II
Bit Mask
Bit Shift
M
B
n/a
n/a
0x003FFFC0
6
0x003FFFC0
6
0x003FFFC0
6
0xFFFFFFC0
6
0x000007C0
6
0x07C00000
22
February 2014 Altera Corporation

Advertisement

Table of Contents
loading

Table of Contents