- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have this problem reported as a service call at Accelerated Technology/
Mentor Graphics (people who make Nucleus Plus RTOS), but thought I'd check here and see if others may be having the same problem. ATI/MG is looking at it right now. Target is 1C20 (Altera demo board). I get the following errors from the linker:C:\MGC\embedded\Nucleus\Plus\Demo>nios2-elf-ld -g o\demo.o -o o\Plus_Demo.out -N -Map o\Plus_demo.map -( ..\..\lib\Plus.lib -T..\..\plus\demo\link_ram.ld -)
..\..\lib\Plus.lib(sdc.o): In function `SDC_Set_Baud_Rate':
sdc.o(.text+0x9f8): undefined reference to `__udivsi3'
..\..\lib\Plus.lib(quc.o): In function `QUC_Create_Queue':
quc.o(.text+0x108): undefined reference to `__udivsi3'
Those two errors are generated from a if (a < (b/c)) type conditional. Everything in the library is compiled with the no-hw-div flag. Any clues? John
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem here looks like ld is being used to link, if gcc were used to link, the correct multilibs would be picked up (there is a different C library depending on whether you have hw mul or not) and the gcc support library would be linked in (which provides functions for operations the processor does not handle natively, e.g. divide, multiply, floating point operations). The name of that library is libgcc.a and is located (depending on multilibs) in this directory structure: <KIT>\bin\nios2-gnutools\H-i686-pc-cygwin\lib\gcc-lib\nios2-elf.3.3
Jonah- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help, Jonah. I changed my linking .bat file to reference the libgcc.a as shown:
NIOS2-ELF-LD -g o\demo.o -o o\Plus_Demo.out -N -Map o\Plus_demo.map -( \altera\kits\nios2\bin\nios2-gnutools\H-i686-pc-cygwin\lib\gcc-lib\nios2-elf.3.3\libgcc.a ..\..\lib\Plus.lib -T..\..\plus\demo\link_ram.ld -)
and now it seems to link. Next stop is to get the debugger working (we have the FS2 JTAG debugger) and prove that it works. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif John

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page