Hi,
Thanks Ben,
But other than putting large const data into
resources, isnt there the (only other) option, that is
to use it as PC-Relative Constant Data. And was
suggested in your 'Expanded Mode white paper' at
meterowerks site, that if we needed to access that
data from another segment we could use a function in
the same segment as the 'PC-Relative Const data' to
return the address of the const data at runtime.
I used #pragma pcrelconstdata on and off to make
the required data PC-relativeconst as my other code
gave problems...but when i link it i dont get earlier
errors like "__RuntimeModule__ : Near data segment is
greater than 64k" ..etc..
...but now i get the ONLY error
"Link Error : Func.c: 'getDataAddress' has 16-bit
data reference to non-data symbol 'Data'."
where my func.c is
/**********************************/
const SomeStructure Data[];
SomeStructure *getDataAddress(){
return(&Data);
}
#pragma pcrelconstdata on
const SomeStructure Data[8192]= {
34,45,67,67,6.......all ints..
....................(no pointer structure members)
};
#pragma pcrelconstdata off
/**********************************/
the Data[] is actually 49152 Bytes <64k
but in the segment info it shows data=0, code=0
..isnt PC-Relative const data attached in codesize?
How do i access 'non-symbol' data?
When i saw the map file
i could see no extra code size in the segment with my
pc-relative-const-data
and the Map file shows:
--------------------------
Data section below A5: 32752 bytes
Data section above A5: 49440 bytes
Initialized near data
Data: -6 6 bytes "@JumpTable"
Data: -24 18 bytes "@JumpTable"
Data: -246 222 bytes "@JumpTable"
Data: -312 66 bytes "@JumpTable"
Data: -438 126 bytes "@JumpTable"
Data: -750 312 bytes "@JumpTable"
Data: -786 36 bytes "@JumpTable"
Data: 40 49152 bytes "Data"----my Data>32K
Data: -25362 24576 bytes "Var2"---OthrConstData<32k
Data: -26130 768 bytes "var1"
Data: -26148 18 bytes "module$528"
Data: -26164 16 bytes "threebitdeltas"
Data: -26172 8 bytes ....
-----------------------------------
Why did the Data[] show here?
Is there an evident problem in the above map info?
The offsets and sizes do not match near my "Data"..
Can anybody tell me where I have gone wrong?
It will be great if someone can help out.
Regards,
Harish
-------
At 10:01 PM 3/24/2004, you wrote:
>I am getting the following link errors.
>
>__RuntimeModule__ : Near data segment is greater than
>64k
>__RuntimeModule__ : Near data segment is greater than
>64k
>PalmOS_Startup: 'MTWK::__LoadAndRelocate__' 16-bit
>data reference is out
>of range.
>
>1,2 should be the problem with Segment 6. The 3rd
link
>error should go
>off if I rearrange the code snippet.
>
>Segment 6 : Code 40 DATA 48k <----- (Problem)
>
>As you can see, the code part is almost zero. It has
a
>constant
>definition of a structure with MANY values assigned.
Segments only deal with code. There's a global data
limitation of 64K that
can't be exceeded in 68K applications.
If you've got a large constant data table, you should
look at moving it to
a resource that gets locked at runtime with a pointer
pointing to
it. There's no other good solution. Sorry.
-- Ben Combee, senior DTS engineer, PalmSource, Inc.
Read "Combee on Palm OS" at
http://palmos.combee.net/
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/