"Heather KML Tufts" <[EMAIL PROTECTED]> wrote in message
news:47977@palm-dev-forum...
>
> > Is there a way to put constant data in code segment? I tried
> >
> > const foo[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
> >
> > but it still gets put in the "Initialized near data" segment,
> > according
> > to the CW7 link map file.
> >
> > I can hack around this by using the asm keyword:
> >
> > asm void foo() {
> >    DC.L 0x01
> >    DC.L 0x02
> > }
>
> Code is code and Data is data.  If you want to pull data out of the
data
> segment, stick it in a database or other resource.

Actually, Heather, this is an undocumented pragma

#pragma pcrelconstdata on

If you use this, then your "foo" will be generated in text, not data.

If your data requires relocations, such as an array of constant
pointers, it will still be generated in the data section.

Enjoy!

--
Ben Combee, [EMAIL PROTECTED]
Techwood Broadcasting Foundation, Austin Bureau



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

Reply via email to