I have a RVDS project for a certain video decoder (its all C code), created for ARM926EJ-S target, executed using the RVDS 2.2 simulator. I am not using any scatterload / <configuration file> / <map file> to mention the various memory segments in the code like Stack segment, Heap, Data segment, Code Segment for RVDS Simulator environment.
- When I add or comment some code (redundant/dead code), then compile the project and execute it, the decoder exits gracefully after mentioning that an error condition has occured , which should not have been the case, as the commented/added code is redundant and does not affect the functionality at all.
- Now if i do the operation opposite to that done in 1.) i.e. uncomment code that was commented in step 1.) and compile and execute, the decoder works perfectly fine till its logically end.
- Same C source/header files work in a MSVC workspace just fine.
I tried to debug a lot through this behaviour but i am not able to pinpoint the cause and the fix for it.
- Is it a case of stack corruption as i add/remove code?
- Is any segment getting overwritten, like Stack segment overflowing into the Data segment, or code segment overflowing into the Data segment?