On 2005-03-02, Thomas Gill <[EMAIL PROTECTED]> wrote: > Paul Schlie wrote: > >> With the arguable exception of function pointers (which need not be literal >> address) all pointers are presumed to point to data, not code; therefore >> may be simplest to define pointers as being 16-bits, and call functions >> indirectly through a lookup table constructed at link time from program >> memory, assuming it's readable via some mechanism; as the call penalty >> incurred would likely be insignificant relative to the potential complexity >> of attempting to support 24-bit code pointers in the rare circumstances >> they're typically used, on an otherwise native 16-bit machine. > > Thanks for the response. > > Suppose we don't have enough space to burn on a layer of indirection for > every function pointer. Do I take it that there's really not a clean way > to make GCC treat function pointers as 24 bit while still treating data > pointers as 16 bits?
FWIW, a port I did used indirection for all function pointers, albeit for a different reason, and I can report that it seems to work OK in practice with a little linker magic. It wasn't really production-quality code though, I admit. Perhaps the indirection table can safely hold only those functions whose address is taken? (Or maybe that was assumed anyway?) Julian -- Julian Brown CodeSourcery, LLC