Hi, I originally thought my extensive used of the gcc extension "Address labels" was the cause of my problems. After inspection of the assembly I realized that they worked perfectly via the trampoline mechanism.. so what was the problem?
I found that prologue_saves calls eijmp at the end, which makes sense, it gets back to the function it was in. However, the EIND register is not set which means it jumps to the wrong section if the function was in the upper section. I verified it by recompiling everything (including avr-libc) without -mcall_prologues and the program seems to run.. (before there was no luck) This issue is pretty easy to fix.. I can set EIND before jumping to prologue_saves.. but this would break when the next eijmp or eicall instruction is executed if I don't set EIND back to 0. The thing confusing me the most right now, is why gcc currently emits eijmp or eicall at all. Since EIND is _never_ set, why did someone go to all the trouble to make gcc emit eijmp and eicall? I want to change gcc to use ijmp and icall always.. then in libgcc.S use eijmp, and set EIND in prologue_saves and I won't have to bother restoring it. If I'm confused about something, or there is a better explanation, let me know. I'm going to modify gcc and have a patch for this soon. Thanks, Sean _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list