Example 6. Returned struct is Larger than 8 Bytes
void b(STRUCT *p_result, int i, int j)
{
...
*p_result = result;
}
void a(...)
{
STRUCT value;
...
b(&value, i, j);
}
7.6. DWARF-2 Definition
Registers
r0
through
r31
are assigned numbers 0 through 31 in all DWARF-2
debugging sections.
7.7. Object Files
Table 84.
Nios II-Specific ELF Header Values
Member
Value
e_ident[EI_CLASS]
ELFCLASS32
e_ident[EI_DATA]
ELFDATA2LSB
e_machine
EM_ALTERA_NIOS2
== 113
7.8. 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 85.
Nios II Relocation Calculation
Name
Value
Overflow
check
(45)
Relocated Address
R
Bit Mask
M
Bit Shift
B
R_NIOS2_NONE
0
n/a
None
n/a
n/a
R_NIOS2_S16
1
Yes
S + A
0x003FFFC0
6
R_NIOS2_U16
2
Yes
S + A
0x003FFFC0
6
R_NIOS2_PCREL16
3
Yes
((S + A) – 4) – PC
0x003FFFC0
6
R_NIOS2_CALL26
(46)
4
Yes
(S + A) >> 2
0xFFFFFFC0
6
continued...
(45)
For relocation types where no overflow check is performed, the relocated address is truncated
to fit the instruction.
(46)
Linker is permitted to clobber register AT in the course of resolving overflows
7. Application Binary Interface
NII-PRG | 2018.04.18
Nios II Processor Reference Guide
154