Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

Nios2 g++ compile error: unexpected reloc type R_NIOS2_UJMP

Altera_Forum
Honored Contributor II
918 Views

Hi everyone. 

 

I'm trying to compile an open source project and run it on a Nios2 soft-core processor running uClinux. 

 

The project contains round 50 files so there is a lot of compiling. So I compile all the files individually using Alteras Nios2 gcc/g++ compiler together with the -c option that produces object files. 

 

So far so good, but when I try to link the all the files together into a single file I get this strange error message: 

 

 

--- Quote Start ---  

 

Err: unexpected reloc type R_NIOS2_CJMP(19) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_CJMP(19) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_CJMP(19) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_UJMP(18) 

Err: unexpected reloc type R_NIOS2_CJMP(19) 

Err: unexpected reloc type R_NIOS2_CJMP(19) 

18 bad relocs 

collect2: ld returned 1 exit status 

 

--- Quote End ---  

 

 

As far as I understand it, uClinux can't handle ELF files. So after I have compiled all the sources files individually, I need to use the argument -Wl,-elf2flt[/B][/B] in the link procedure in order to convert my final file from ELF to FLT format. I can link the program without errors if I neglect the -Wl,-elf2flt [/B][/B]option but with it I get the error messages above. 

 

There isn't really much to find on google about this matter unfortunately. The only relevant page I found is from Alteras forum but that thread went cold four years ago. Here is the link nevertheless: http://www.alteraforum.com/forum/showthread.php?t=20134&highlight=r_nios2_ujmp  

 

Is there anyone that knows what can be wrong? If you need any files or information don't hesitate to ask.  

 

Thank you in advance, 

Erik
0 Kudos
0 Replies
Reply