On 2005-12-10, Troy Lokitz <[EMAIL PROTECTED]> wrote:
> I've included output from a couple of build scenarios.  When i don't use -T 
> text_64k i get:
>
> /usr/m68k-palmos/bin/ld: region coderes is full (HeatMail section .text)
> /usr/m68k-palmos/lib/crt0.o(.text+0x46): In function `start':
> crt0.c:62: relocation truncated to fit: DISP16 _GccRelocateData
> /usr/m68k-palmos/lib/crt0.o(.text+0x50):crt0.c:64: relocation truncated to 
> fit: DISP16 __do_bhook
> /usr/m68k-palmos/lib/crt0.o(.text+0x5a):crt0.c:67: relocation truncated to 
> fit: DISP16 __do_ctors
> /usr/m68k-palmos/lib/crt0.o(.text+0x70):crt0.c:72: relocation truncated to 
> fit: DISP16 __do_dtors
> /usr/m68k-palmos/lib/crt0.o(.text+0x7a):crt0.c:74: relocation truncated to 
> fit: DISP16 __do_ehook
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x16): In function `__do_bhook':
> hooks.c:28: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x64): In function `__do_ehook':
> hooks.c:44: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xa6): In function `__do_ctors':
> hooks.c:60: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xe0): In function `__do_dtors':
> hooks.c:76: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(multi_dreloc.o)(.text+0xe): In function 
> `_GccLoadCodeAndRelocateData':
> dreloc.c:56: relocation truncated to fit: DISP16 start
> collect2: ld returned 1 exit status
> make: *** [HeatMail] Error 1
> Build complete for project HeatMail
>
>
> Notice in the following output that it doesn't give the coderes error.  When 
> I use the text_64k script that came with pods, i get:
>
> /usr/m68k-palmos/lib/crt0.o(.text+0x46): In function `start':
> crt0.c:62: relocation truncated to fit: DISP16 _GccRelocateData
> /usr/m68k-palmos/lib/crt0.o(.text+0x50):crt0.c:64: relocation truncated to 
> fit: DISP16 __do_bhook
> /usr/m68k-palmos/lib/crt0.o(.text+0x5a):crt0.c:67: relocation truncated to 
> fit: DISP16 __do_ctors
> /usr/m68k-palmos/lib/crt0.o(.text+0x70):crt0.c:72: relocation truncated to 
> fit: DISP16 __do_dtors
> /usr/m68k-palmos/lib/crt0.o(.text+0x7a):crt0.c:74: relocation truncated to 
> fit: DISP16 __do_ehook
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x16): In function `__do_bhook':
> hooks.c:28: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x64): In function `__do_ehook':
> hooks.c:44: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xa6): In function `__do_ctors':
> hooks.c:60: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xe0): In function `__do_dtors':
> hooks.c:76: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(multi_dreloc.o)(.text+0xe): In function 
> `_GccLoadCodeAndRelocateData':
> dreloc.c:56: relocation truncated to fit: DISP16 start
> collect2: ld returned 1 exit status
> make: *** [HeatMail] Error 1
> Build complete for project HeatMail
>
>
> The following output doesn't appear to have changed.  When i add the line to 
> the text_64k file that you mentioned in a former email [PROVIDE(__text__ = 
> .);] i get:
>
> /usr/m68k-palmos/lib/crt0.o(.text+0x46): In function `start':
> crt0.c:62: relocation truncated to fit: DISP16 _GccRelocateData
> /usr/m68k-palmos/lib/crt0.o(.text+0x50):crt0.c:64: relocation truncated to 
> fit: DISP16 __do_bhook
> /usr/m68k-palmos/lib/crt0.o(.text+0x5a):crt0.c:67: relocation truncated to 
> fit: DISP16 __do_ctors
> /usr/m68k-palmos/lib/crt0.o(.text+0x70):crt0.c:72: relocation truncated to 
> fit: DISP16 __do_dtors
> /usr/m68k-palmos/lib/crt0.o(.text+0x7a):crt0.c:74: relocation truncated to 
> fit: DISP16 __do_ehook
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x16): In function `__do_bhook':
> hooks.c:28: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0x64): In function `__do_ehook':
> hooks.c:44: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xa6): In function `__do_ctors':
> hooks.c:60: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(hooks.o)(.text+0xe0): In function `__do_dtors':
> hooks.c:76: relocation truncated to fit: DISP16 start
> /usr/m68k-palmos/lib/libcrt.a(multi_dreloc.o)(.text+0xe): In function 
> `_GccLoadCodeAndRelocateData':
> dreloc.c:56: relocation truncated to fit: DISP16 start
> collect2: ld returned 1 exit status
> make: *** [HeatMail] Error 1
> Build complete for project HeatMail
>
> Is there a bug in the script or am i doing something wrong?
>
> Thanks,
> Troy
>
> When i use the original test_64k script
>

The text_64k linker script only allows coderes to grow beyond 32K. When you look
at how your program is linked, you'll see the first file is crt0.o. The start 
routine
(which also calls your PilotMain) is also calling the bhook, ehook and 
constructor/destructor
functions. These get linked in from the C-library (libcrt.a) and placed after 
all your
routines. Since the calls in start.o use signed 16-bit relative addressing 
(DISP16)  you still have
the 32K limit. In your case the routines cannot be reached from start.o.
Ome way out is to manually arrange your object files in such a way that no 
routine called
is more than 32k away from the callee. In your case you will have to force 
hooks.o and multi_dreloc.o
from the library within 32K of the start of the .text segment.

HTH

Ton van Overbeek

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

Reply via email to