Hello folks,

I am trying to convert my (managed makefile) application into a multi-segment 
one. In particular, I would like to put in a separate code segment one function 
and all functions called by it (they aren't called by anything else). So far, 
I've done the following:

1) Added a Sections.def file to my project, with the following contents:

application { "AppName" CrID }

multiple code { "code1" }

(where "Appname" is the name of my application and "CrID" is its creator ID).

2) Added a Sections.h file to my project, with the following contents:

#ifndef _SECTIONS_H
#define _SECTIONS_H

#define SECTION2  __attribute__ ((section ("code1")))

#endif 

3) Added a

#include "Sections.h"

line to the source file of my application (there is only one).

4) Changed the prototypes of all functions that I want to put in the second 
code segment from

RetValueType functionName (blah-blah);

to

RetValueType functionName (blah-blah) SECTION2;

Unfortunately, I still cannot compile the project. :-( I get the error

/usr/m68k-palmos/bin/ld: warning: no memory region specified for section `code1'
FileName.c:LineNum: undefined reference to `__text__code1'

where "FileName.c" is the source of my application and "LineNum" is the number 
of the line on which I call the main function that I want to put in a separate 
segment.

Any hints what I am doing wrong?

I am assuming that if I don't add a "SECTION2" to the prototype of a function, 
it will go into code 1. Do I have to create an __attribute__ for code 1 too - 
and add "SECTION1" to the prototypes of all functions that have to go into the 
code 1 resource? Do I have to add "SECTION2" also to the implementation of the 
functions - not just to their prototypes?

At a guess, the problem occurs because I am using a managed makefile project 
and originally it was created as a single-segment project. For instance, its 
automatically generated makefile does not contain

MULTIPLE_CODE_SECTIONS = TRUE

Any ideas how to tell a managed makefile project that it should be a 
multi-segment project? What project properties to modify?

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

Reply via email to