The AVR libc docs show how to safely get MCUSR copied into a variable and reset early (as required to prevent possible infinite resets) in the top of this page:
What I'm wondering is how to safely transmit the mcusr_mirror variable discussed there from the bootloader to the main application program. I'm building both programs from C. I think it should be possible to put the contents in a high memory byte or perhaps a register. Somewhere that is safe from the compiler anyway. But where?
I guess this is really a general question about how to transmit a bit of stuff from bootloader to main program, when both are in C, without having to resort to EEPROM. It might be a good idem for the bootloader faq.