Hi Amit,

the subject "multiple code segment" runs through this group every there and then. Have a look into the archive for old answers. But to make it short (maybe it's already sufficient for you) all you have to do is:

1. write an "application.def" file with:

application { "ApplicationName" CreatorID }
multiple code { "Seg1" "Seg2" ... }

2. add some lines to your makefile:

application-sections.o: application-sections.s
m68k-palmos-gcc -c application-sections.s

application-sections.s application-sections.ld: application.def
multigen application.def

and add "application-sections.o" and "application-sections.ld" to your linker rule:

e.g. :

application: application1.o application2.o application-sections.o
$(CC) application1.o application2.o application-sections.o -o application application-sections.ld


3. Now you change the function declarations:

Take some functions which you want to have in a different section and add "__attribute__ ((section ("Seg1")))" behind the declaration.

If you don't add this to the function declaration, the function will stay inside the default segment. Some functions like PilotMain have to stay inside the default segment. So you better spilt your source files into several files (best guess, put things belonging to one form, one function together in one file, as you would do with classes in C++/Java) and put every source file, except/but the main file, into one segment. Voila never have any problems with code segments anymore.

Henk


Amit Solanki wrote:
Hello all,
I have developed an standard application without multiple segments.
But now it caused code regions is full after writing too long code.

So now I am trying to port it to multiple code segment. But now I am facing
lots of problems to port it to multiple code segment.
Is there any good tutorial or help article on this?

I am using GCC and prc tools Thanks,
Amit Solanki



--
-------------------------------------------------------------------------
[EMAIL PROTECTED]                                       www.metaviewsoft.de

<A HREF="http://www.handango.com/PlatformTopSoftware.jsp?authorId=95946";>
<IMG SRC="http://user.cs.tu-berlin.de/~jonash/werbung_palmos.jpg";></A>
-------------------------------------------------------------------------


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

Reply via email to