Thanks to all who have helped me to get the best solution. I have eventually decided that an assembler jump table was really the best in my application: /* ****************************************************************************** * Function entry points for independent test routines ****************************************************************************** */
// Function declarations void test_lcd_2(PGM_P); void test_lcd_string(PGM_P); . . //Snip/ . void test_flash_read(uint16_t); void test_flash_write(uint8_t, uint8_t); void jumptable(void) __attribute__((__naked__)); FUNCTION_SECTION void jumptable(void) { asm ("test_lcd_2: jmp prog_lcd_string2"); asm ("test_lcd_string: jmp prog_lcd_string"); . . //Snip/av . asm ("test_pgm_read_byte: jmp flash_read_byte"); asm ("test_pgm_read_word: jmp flash_read_word"); } ====================================================== Curiously I could not use e.g. asm ("test_pgm_read_byte: jmp pgm_read_byte"); "undefined reference to 'pgm_read_byte'" although it is defined and in scope. Where pgm_read_byte is a library function from avr-libc. I had to supply a stub function of my own [flash_read_byte()] to, in turn, call pgm_read_byte() and then it was happy :-) Thanks to all, Robert. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list