On Thursday 10 April 2008 01:15, Stu Bell wrote: > "Is avr-gcc for avr6 ready to use?" Yes, with warnings. Since gcc > insists on the size of a function pointer to be 2 bytes, anything using > function pointers must be used with caution. If the function resides in > the lower half of flash, the 2 byte pointer works fine. > > The problem is when the function resides in upper memory. Then, the 2 > byte pointer will point to the wrong place. > > Note that normal function calls work fine. Avr-gcc has been modified to > handle that case, through the use of the linker "trampoline" section. > It is just function pointers that give problems.
Hi. Yes, the avr6 extension was disign to obtain indirect function calls throw "trampoline" stubs. This stubs must allocated in low part of flash and the 16-bit address must be sufficient. However the implementation is wrong: trampoline is created, but the gs() is transformed incorrectly in part of cases. As the AVR Binutils port is not maintaned, IMHO, we must to provide a workaround of this bug. I tend to write a special variant of 'eeprom' functions for avr6 architecture, near to the Stu Bell's patch. Dmitry. _______________________________________________ AVR-libc-dev mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-libc-dev
