Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Relocate ELF

Altera_Forum
Honored Contributor II
1,280 Views

Dear all (welcome back online!), 

does anyone know how to relocate a Nios Executable, so it can be launched from addresses other than offset zero of memory? 

I think the best way should be the GCC option -pie (position independent executable) but it appears not supported by Nios. 

 

At this time I manually edit the generated.x file fixing memory start addresses and rebuild. However this approach appears too tricky and error prone to me . 

 

In addition (I tried to relocate the ELF by myself), looking at the Nios Processor reference I read: 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

In a Nios II object file, each relocatable address reference possesses a relocation type. The relocation type specifies how to calculate the relocated address.Table 7–3 lists the calculation for address relocation for each Nios II relocation type. The bit mask specifies where the address is found in the 

instruction.[/b] 

--- Quote End ---  

 

when it talks about object I assume it refers to "obj/*.o" file that is a "relocate elf". But in this file I can&#39;t retrieve enough relocation information, not all jumps are referred, neither those relative to HAL calls. 

 

Thank you, 

regards
0 Kudos
0 Replies
Reply