Solved

Region datares is full

Posted on 2003-11-15
5
393 Views
Last Modified: 2013-12-27
C:\PalmDev\tutorial\Demo3>M68k-palmos-gcc -palmos3.5 -O3 demo3.c -o demo3
/prc-tools/H-i586-cygwin32/m68k-palmos/bin/ld: region datares is full (demo3 sec
tion .bss)
collect2: ld returned 1 exit status

I have created a number of structures, and when i compile, it shows the above error, does anyone know what's the problem of my program, is it the memory is all used up?

thx a lot
0
Comment
Question by:gogojump
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
Ivan Rivera, MTI, SCPM, ITIL, Cobit, PMP earned 125 total points
ID: 9757712
Hi....

I founf the answer in google. I trasncript it:

"region datares is full" means the limit of 32 k is exceeded;
one segment can only be 32 k big - not 64.
A workaround can be hard, dunno how in MC++ anyway.
(The folks at CASL are as well still fighting with this problem
in their CASLPro version)

I have found a page dealing with this issue, it might be helpful.
The titel of the page: GCC programming tricks for the PalmPilot

Cheers, Max

========================================
GCC programming tricks for the PalmPilot
========================================

Having more than 32k code
-------------------------
It has often been said, that this is not possible, but this is wrong.
In fact, there're two ways to overcome the 32k limit. The first one is
using
shared libraries, which has some problems (e.g. accessing global data)
and the second one is described here.

Your PilotMain() is not the first function called when your app
starts. The (normal) entry point is a function start(), which is
buried in the
object module crt0.o. (This module is automatically put at the
beginning of the code section by the linker) start() relocates the
data segment
and calls some "hooks" (I don't know, what these hooks exactly do, but
it seems that you need them).

The PalmOS starts an app by simply jumping to adress 0, where the
start() function is put by the linker.

Now here comes the problem: start() is at the very beginning of the
code segment, then your code follows and the hooks are at the very
end, so to call the hooks from start(), they must be within 32k (the
range of the relative branch instructions of the 68000), so normally
your code mustbe <32k.
/
start()
<32k
your code
\
hooks

Now the trick is to put start() in the middle of your objects and
provide an entry function myStart() at adress 0, which simply calls
start().

When start() is within 32k of myStart() and the hooks are within 32k
of start(), you have TWO 32k ranges to put your code. Of
course you must ensure (by shuffling your functions and objects) that
calls between your functions don't exceed the 32k branch limit.

/
myStart()
<32k
your code
\
/
start()
<32k
more of your code
\
hooks

That's the theory, to make this work you have to do the following:
1.Increase the coderes size in the file pilot.ld. Here's mine:
MEMORY
{
coderes : ORIGIN = 0x10000, LENGTH = 65535
datares : ORIGIN = 0x0, LENGTH = 32767
}

SECTIONS
{
.text :
{
*(.text)
. = ALIGN(4);
bhook_start = .;
*(bhook)
bhook_end = .;
. = ALIGN(4);
ehook_start = .;
*(ehook)
ehook_end = .;
} > coderes
.data :
{
data_start = .;
*(.data)
} > datares
.bss :
{
bss_start = .;
*(.bss)
*(COMMON)
} > datares
end = ALIGN( 4 );
edata = ALIGN( 4 );
}

2.Compile the following file (start.c):

extern unsigned long start();
unsigned long myStart()
{
return start();
}

3.Link with a command like this:
$(CC) $(LDFLAGS) -nostartfiles start.o some objects $(CRT0) more
objects $(LIBS) -oyourprog

The option -nostartfiles tells the linker not to automatically
use crt0.o as the first object.

The original address of the answer is:
http://groups.yahoo.com/group/mobileStudio/message/467?source=1

Ivan Rivera
0
 
LVL 3

Expert Comment

by:olan75
ID: 9834370
You must have declared a very big amount of static data.
A simpler solution might be to allocate it dynamically when your app starts, using MemHandleNew, and free it when your app exits using MemHandleFree
0
 
LVL 6
ID: 12232778
Hi...

Does it work? Do you need further help?

Ivan Rivera
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question