I am using mspgcc4.
The "warning: internal error: unsupported relocation error" are all
related to pointer to functions (in my case), details below.
I found mspgcc bug 5815 (fixed a few months ago). But it appears that
this bug also exists in MSPGCC4_r4-20100210.
menu.h
======
struct menu
{
// Pointer to direct function (start, stop etc)
void (*sx_function)(u8 line);
// Pointer to sub menu function (change settings, reset counter etc)
void (*mx_function)(u8 line);
// Pointer to display function
void (*display_function)(u8 line, u8 mode);
// Display update trigger
u8 (*display_update)(void);
// Pointer to next menu item
const struct menu *next;
};
menu.c
=======
#define FUNCTION(function) function
const struct menu * ptrMenu_L1 = NULL;
const struct menu * ptrMenu_L2 = NULL;
const struct menu menu_L1_Time = // this is just one of several a linked
list
{
FUNCTION(sx_time), // direct function
FUNCTION(mx_time), // sub menu function
FUNCTION(display_time), // display function
FUNCTION(update_time), // new display data
&menu_L1_Alarm,
};
main.c
=======
void (*fptr_lcd_function_line1)(u8 line, u8 update);
// the errors originate in main.c with lines like the following
// from function init_global_variables
// both lines generate the error
ptrMenu_L1 = &menu_L1_Time;
fptr_lcd_function_line1 = ptrMenu_L1->display_function;