--- Quote Start ---
The nios's call (and jump) instruction encodings only have 26bits for the target address (the least significant bits are always zero) so a direct call (ie not through a register) cannot cross a 28bit boundary as the high 4 address bits aren't changed.
Without special code (which could, in theory, be added by the compiler or linker) this limits a program to 256MB. Within Linux (or similar) it will also stop shared libraries being loaded with code crossing a 256MB boundary).
To get the warning you must either have instruction memory in more than one 256M block of address space - eg more than 256M of DRAM or DRAM and internal code memory.
This warning itself can be ignored, but you have have to use function pointers if you need to call between the code areas. The linker will error these attempts.
--- Quote End ---
(Sorry for not being more active here; Altera keeps me pretty busy.)
A few updates on this sort of stuff:
nios2-elf-gcc 4.7 supports -Wa,-relax-all that allows 2GB programs at the cost of using multi-instruction sequences for every call (i.e. callr in place of call). Nobody is very happy with this solution, but it is there and is believed to work.
nios2-elf-gcc 4.8 has 2GB-codespace support that basically Just Works, no special switches needed. This is done via linktime optimization (no relationship to -lto please note) which redirects out-of-range calls to local trampolines which then do the required multi-instruction callr dance. (nios2-elf-gcc should be available from Mentor within a week or so at
http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/, and later in ACDS 14.1)
nios2-elf-gcc 4.8 will have -mno-gpopt support again (present in nios2-elf-gcc 4.1.2 but missing from nios2-elf-gcc 4.7.3). Useful if your 64K .sdata segment is overflowing; bypasses the small-data optimization for the current compilation unit.
nios2-linux-gnu-gcc 4.8 will have the -fpic/-fPIC distinction where the latter supports a > 64K GOT table. (Nios2 Linux c++ hackers have been hitting this limit.) Also -fpic supports 64K GOT table where 4.7 -fpic supported 32KB -- pointer is biased by 32K to allow use of negative offsets as well as positive offsets.
Yesterday I discovered that apparently post-4.1.2 nios2-elf-gcc thinks that Nios2 builtins can throw exceptions; this can result in very small nios2-elf-g++ programs trying to fit into onchip RAM no longer fitting due to pulling in lots of exception-handling baggage. -fno-exceptions is a workaround for this problem.
(BTW, on other fronts, Nios2-linux support is in the tubes for *crossfingers* mainline linux kernel 3.15 (
https://lkml.org/lkml/2014/4/18/216) and nios2 support for mainline gcc 4.9. We're well on the way to having full nios2 support out-of-the-box in the complete Linux/GNU world. (Whee!!) And you didn't hear this from me, but Nios2R2 should allow full 4GB codespaces when it eventually trickles out to the wider world. No I can't, so don't ask. But if you look closely you'll be seeing "Nios2R2" starting to creep into opensource Altera releases from here on out. :-) )