At 06:58 AM 11/28/2003, Regis St-Gelais wrote:
Hi Ben,

"Ben Combee" <[EMAIL PROTECTED]> a �crit dans le message de
news:[EMAIL PROTECTED]

> This is due to having the "PC-relative const data" switch on.  This make
> constant data accessed through the PC, which only allows intra-segment
> references.  Turning that off would push the constant data into the data
> segment where it can be seen by all.
>
But if I turn off the "PC-relative const data" my const will be put in the
global data segment, wont they?
My goal was to reduce my usage off the global data segment so I can put
variables in it.

I thing I will use the tSTL aproach to store my const strings.

You could also do something like


const char str[2][] = { "a", "b", "c", "d" };
const char **access_str() { return str; }

and have code in other segments call access_str to get the address of the data. Once that is known, you're OK. It's just that the linker can't fix a data reference to another code section, but it can fix a code reference since those go through an executable jump table stored in the data section.


--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to