I have completely reconstructed all of my header files to make sure I 
have no duplicates, etc.  I am currently using jump islands to get 
around the 32k jump limit but it's getting tougher.  So, I decided to 
try and get multiple code resources to work with prc-tools 2.0 but I 
am having no success, yet.

I have 13 source files (maybe I should have picked a luckier number), 
each has a cooresponding header file.  Before I began, I compiled 
this application using the jump islands.  It compiled, linked and 
executed just like it is supposed to.  I then made a copy of this 
folder and began converting it to using the prc-tools section 
attribute method.  

Below you will see the grouping of the sections that I used.  I added 
the attribute macro to each header file and added the SECTION_* to 
each function in the header declarations.  Every function in each 
source file was placed into it's own section with the exception that 
the MyApp and MathLib were not modified (default section).

The program compiled, linked and installed without problems.  But I 
find that much of the application NOW does not work.  I have tested 
this under POSE and often, the program will just hang, without any 
diagnostic information.  Other times I will get an "illegal 
operation, bus error" message from POSE.

I made NO code changes when making this transition, except to remove 
all the CALLBACK_EPILOGUE and PROLOGUE.  Although, I tested this both 
ways first.  I even continued to use jump islands, to guarantee that 
there were no code changes.

The one functions that does not work correctly that is fairly simple 
will be shown here.  Maybe there is a clue there.  What this function 
is supposed to do and did before the attribute stuff was added, was 
to write two rows of text labels across a form.  The X location was 
changed for each button.  BUT what actually happens NOW, is that all
6 text labels are written at the same location in the leftmost 
position.  It's as thought the X is not bein calculated correctly.

labelNamePtr is a global array and fmod is a MathLib function.  
Anyone have any problems why this would now stop working just because 
of the multiple code resource stuff that was added.  It's acting as
though fmod(i,6) is returning zero.  Why would that happen, just 
because of the multiple code resource changes?

void SetUserButtons(Int16 set) {
    FormPtr     form;
    Int16       i, j, offset;
    Char        name[33];
    RectangleType   r;

    r.extent.x = 22;
    r.extent.y = 11;
    form = FrmGetActiveForm();
    SetTextColor(0xFF, 0xFF, 0, 0, 0, 0xCC);
    for(i=0, j=12*set; i<12; i++) {
        StrCopy(name, labelNamePtr[j++]);
        name[4]= 0;
        r.topLeft.x = fmod(i,6)*27+1;
        r.topLeft.y = 40 + ((Int16)((i)/6))*15;
        WinFillRectangle(&r, 0);
        offset = 11- (Int16)(FntCharsWidth(name, StrLen(name))/2);
        WinDrawChars(name, StrLen(name), r.topLeft.x + offset, 
r.topLeft.y);
    }   
    SetTextColor(OldFC.r, OldFC.g, OldFC.b, OldBC.r, OldBC.g, 
OldBC.b);
}

Does anyone have any other suggestions as to what could be the 
problem?



The stuff below relates to files on my PC.

The following section is a list of object modules shown
on my PC after the application was built, without using
the section attributes or multiple code resources.  I 
used this info as a sanity check on the code resources 
shown on the palm using RsrcEdit.  Don't know if they 
are sane or not.

Default (code0001 size = 26716 using RsrcEdit)
-------
MyApp    O          29,696  04-07-00 10:29a MyApp.o
MATHLIB  O           2,205  04-07-00 10:29a MathLib.o

utils (code0002 size = 8842 using RsrcEdit)
-----
UTILIT~1 O          13,841  04-07-00 10:29a Utilities.o
MULTITAP O           5,364  04-07-00 10:29a MultiTap.o
COLOR    O           2,786  04-07-00 10:29a color.o
ISLAND   O           2,364  04-07-00 10:29a island.o

eval (code0003 size = 10908 using RsrcEdit)
----
EVALUA~1 O          22,548  04-07-00 10:29a Evaluate.o

math (code0004 size = 5888 using RsrcEdit)
----
BASE     O           5,177  04-07-00 10:29a base.o
STORAGE  O           6,455  04-07-00 10:29a storage.o
FINANCE  O           3,478  04-07-00 10:29a finance.o

file (code0005 size = 7368 using RsrcEdit)
----
REG      O           3,132  04-07-00 10:29a Reg.o
IMPORT   O           6,478  04-07-00 10:29a import.o
MYAPPDB  O           8,499  04-07-00 10:29a APCalcDB.o

-------------------------------------------------------
MyApp (def file)
    application { "APCalc" XCal }
    multiple code { "utils" "eval" "math" "file"}
-------------------------------------------------

-------------------------------------------------------
MyApp (sections file)
/* DO NOT EDIT!
   This file was automatically generated by multigen
   from MyApp.def  */

        .file   "MyApp-sections.s"

        .globl  __text__
        .lcomm  __text__,4
        .globl  __text__utils
        .lcomm  __text__utils,4
        .globl  __text__eval
        .lcomm  __text__eval,4
        .globl  __text__math
        .lcomm  __text__math,4
        .globl  __text__file
        .lcomm  __text__file,4

        .globl  __code_section_count
        .equ    __code_section_count,5

.text
        .globl  _GccRelocateData
_GccRelocateData:
        bra.w   _GccLoadCodeAndRelocateData

.section ehook
        .long   _GccReleaseCode
--
-----------------------------------------------------------------
Discussion Group:        http://www.halcyon.com/ipscone/wwwboard/

Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to