- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just tried making a new eCos RedBoot project (using the redboot template) for my board, without adding any other packages, and it gives me this gem when I try to build the library:
nios2-elf-gcc -g -nostdlib -Wl,--gc-sections -Wl,-static -mhw-mul -mno-hw-mulx -mno-hw-div -L/cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_install/lib -Ttarget.ld -o /cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_install/bin/redboot.elf /cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_install/lib/version.o
make: Leaving directory `/cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_build/redboot/current'
/cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_install/lib/libtarget.a(redboot_main.o)(.text.do_idle+0x14): In function `valid_address':
make: Leaving directory `/cygdrive/c/cygwin/home/desimone/Projects/lmrs/transmitter/wf-gen-ether/software/redboot_build'
/cygdrive/c/altera/kits/nios2/components/ecos/ecos-current/packages/redboot/current/src/main.c:756: Unable to reach __RedBoot_IDLE_TAB_END__ (at 0x08011cac) from the global pointer (at 0x08019cc4) because the offset (-32792) is out of the allowed range, -32678 to 32767.
collect2: ld returned 1 exit status
make: *** Error 1
make: *** Error 2
Any ideas?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To wok around this kind of problem, you can compile your code with the -G0 flag. This disables gp relative addressing and so avoids these kinds of range issues. The down side is that this will cause your code to run slower.
You will find some further discussion of this in the thread "global pointer relative offset" which may help you track down the underlying cause. I suspect that the problem is that __RedBoot_IDLE_TAB_END__ is being accessed using relative addressing, when it should be accessed using absolute addressing. If you look in the "General Software" section of the Nios forum, you will find a couple of threads: "Disabling GP-addressing in generated source code" and "pointer out of range link error" that discuss how you can disable relative addressing for a specific variable.
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