Bug #1130
add compiler directive to prevent stack junk
| Status: | Fixed | Start: | 02/23/2010 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assigned to: | Kevin Woo | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Votes: | 0 |
Description
Everytime we call main_start we we leaving the shell of the bootloader on the stack. If we declare it with attribute((noreturn)) in the prototype it will prevent this.
example:
typedef void (*AppPtr_t)(void) attribute ((noreturn));
AppPtr_t AppStartPtr = (AppPtr_t)XxXXXX;
AppStartPtr();
History
Updated by Kevin Woo almost 2 years ago
- Status changed from Assigned to Fixed
Made the main function in the bootloader naked which should do the same thing. This will prevent recursive calls to it from taking up too much stack space.
Updated by Kevin Woo almost 2 years ago
Adding this to the main function actually fails. It makes more sense to add this to the main_start function pointer. It saved us about 8 bytes of instructions. This one worked.