Forum Discussion
Altera_Forum
Honored Contributor
15 years agoStatic variables on the stack? Really? I don't have the compiler in front of me right now, but every other compiler I've worked with would not put static variables on the stack, because there is no need. They're static, so they go into memory with the global variables.
One thing I do know. a lot of times, the error messages are absolutely no help at all and will actually tell you to look for a problems far, far away from where the problem actually is. However, I have seen a similar type of error from another cause. Seems that many memory access are done relative to the gp register, something like: (load register) r2,XXXX(gp) ; I forget the exact mnemonics, but it's something like this This means: use the value in the gp register, offset it by the 16-bit immediate value XXXX and put the value at that memory location in r2. The problem is if it is more than +-32K away, it fails with a whole string of error messages, most of them being completely negatively helpful, but I think I remember things like 'reloc' errors, and similar. It's been awhile since I saw this, but I think it came from having overlapping addresses assigned for memory in SOPC. I used the auto assign addresses, regenerated the processor, generated a new BSP, and recompiled. The compiler was much happier after that. Don't know if it will help, but thought I'd offer.