> Currently the complete ".rodata" section is copied from load address
> (ROM) to RAM, that is by treating it similar to ".data" section.

Right, the linker scripts know which chips have accessible flash and
which don't.

> We went through the discussion in the following link and realized
> that there should not be 2 pointers for the same data type as of
> now.  http://gcc.gnu.org/ml/gcc-patches/2005-08/msg01129.html Can
> the size of data pointer be increased to 20 bit? If yes, please
> guide me in implementing the same.

The problem here, and with having size_t be bigger than 16 bits, is
that these chips have no efficient way to compute 20 bit values - they
always do 32 bit math and truncate the result (at least, in gcc).
This means that adding "large pointer" support makes the code VERY
slow, especially as the m16c has a very limited set of opcodes that
can use large pointers.

To use the large pointers in m16c, you'd need to figure out a way to
determine when it's safe to do so, mark the data with some attribute
that lets the m32c backend tell that it's going to be in flash, and
somehow limit gcc to using the few large-pointer opcodes.

This will probably be similar to GP (.sdata) variables, except that
you can't just compute their address and use the resulting pointer
like any other pointer.

(if it were easy, I would have done it a long time ago ;)

Reply via email to