"Max Campos" <[EMAIL PROTECTED]> wrote in message news:72774@palm-dev-forum... > > I'm porting a rather large application by PalmOS standards -- it has > _thousands_ of methods, and approximately 450 source *.c files.
Are these true C source files or C++ files? > > Well, i've split it into 18 segments, none of which is codewarrior > complaining that is too big, but I get the following error messages: > > __RuntimeModule__: Near data segment is bigger than 64k. (twice) > blah.c: 'METHOD_name' 16-bit data reference to 'other_method' is out of > range. (a zillion of these) > > The first segment is only 29K/2K data. The display is misleading. It is not counting data that goes into the expanded data segment in its total. However, expanded mode currently only helps C++ programs, since the data we store there is mostly compiler-generated tables. > Normally, I would take one look at this and just assume that I left a > compile option obviously wrong, but after reviewing the target settings and > recompiling the errors persist. I'm using the following settings: > > Codewarrior 8 > - 68K target - Expanded mode > - 4 byte ints > - PalmOSRuntime_4i_A4A5.lib, located in the first segment, along with > StdIOPalm.c (it's a stdio app) > - Project type: "Palm OS Application" > - Code Model: smart > - 4 byte ints, checked > - Link single segment UNCHECKED > > One thing that i've noticed OTOH, is that there is a large amount of > globals being used (as determined by looking at the "Data" column of the > segments view) -- approximately 80K's worth (though the largest number in > one segment is 26K). Right -- these globals in the expanded segment include your virtual tables and many of the tables used for exception handling. Unfortunately, the shipping verison of CW Palm V8 doesn't show the expanded data sections layout in the link map. A version of the linker that outputs that should be part of the 8.2 patch, currently being finished. > Is there some kind of limit to the total amount of globals allowed for a > *.PRC ? Or is there something else that i'm missing? Yes. Generally, your data is limited to 64K, with no one item exceeding 32K. When you use expanded mode, you get an additional data section of 64K for data that doesn't change during a program's run. Virtual tables and exception tables go here. See my white paper at http://www.metrowerks.com/pdf/Expanded_Mode.pdf. It explains a lot about why these limits are there. I've also written some about this at http://www.palmoswerks.com/, my personal Palm OS development site. If you still have problems, contact Metrowerks support -- we can get you early access to some tools through those channels. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
