Altera_Forum
Honored Contributor
15 years agogcc3 and gcc4 for nios in Altera 10.0
I've just downloaded the gcc sources (gcc3 and gcc4) for Altera 10.0 from the Altera ftp site.
AFAICT the gcc3 sources are identical to those from the 9.1 release (except that the version and build number have both been set to zero). The gcc4 sources don't seem to contain my patches, however I can't actually build the 'gas' in binutils-2.17 because the gcc I'm using (Debian 4.3.2-1.1) detects a real buffer overrun! (I've tried a patch). From the diffs of the nios2.c and nios2.md it looks as though they've made 2 rather unwanted changes that will need patching out by anyone trying to build a very small embedded system: 1) The jump table for switch statements looks as though it is being put into the .code segment (not the .rodata segment). On systems where all code and data is in tightly coupled memory this isn't wanted - this will be a slow avalon bus xfer, and the slave access to the code memory need not otherwise be enabled. Ideally this data could be in its own section - the linker script can then assign it to an appropriate memory region. In my case I'd like to get a shorter jump table sequence by using 'gp' relative addressing! 2) gp relative addressing seems to have been disabled for external data items (some comment about them not necessarily being defined in the .sdata section in the other file). I think this will apply even for definitions like:extern uint32_t *mtp2_cmd_isr section(.sbss); which is very fubar. Possibly it might make sense to not default to putting small extern data into the .sdata segment.