Re: [arm-gnu] how to locate a const struct in memory (ld question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] how to locate a const struct in memory (ld question)



On Monday, May 10, 2010 09:35:21 pm Charles Manning wrote:
> The way I'd tackle this is through a double indirection.

> struct func_table *table_ptr = *((struct func_table **) ADDR_OF_POINTER);

> Now have local wrapper functions
> 
> int func_a(int x)
> {
> 	return table_ptr->func_a(x);
> }

I looked at doing it that way, but the generated code is larger since it must 
load the pointer and dereference it to get to the function pointer.

I guess this is the typical portability/features tradeoff. :-)

-A.