Hello,
I am using Watcom C 10.6 and QNX 4.25 to compile/link a C program using
the small memory model, e.g.,
wpp386 -ms -ze -4s -sg -bt=QNX program.c
wlink na exename f program op offset=4K op st=16K op map=mapfile form QNX
(note that the default cc chooses a stack of 32K and this crashes the code).
My question is does the small memory model mean that separate 64K spaces
are used for the code and data, or must both the code and data must fit in the
one 64K space ?
The map file indicates that the data follows directly on from the code in
memory, data starting at address 0x0000EA97 in the following part of the
map file (best viewed with a fixed width font),
WATCOM Linker Version 10.6
Copyright by WATCOM International Corp. 1985, 1996. All rights reserved.
Created on: 01/01/01 15:24:06
Executable Image: Snav
creating a QNX 386 executable
±-----------+
| Groups |
±-----------+
Group Address Size
===== ======= ====
DGROUP 0000f000 0000c210
±-------------+
| Segments |
±-------------+
Segment Class Group Address Size
======= ===== ===== ======= ====
BEGTEXT CODE 00001000 00000006
_TEXT CODE 00001010 0000da87
printf11_DATA FAR_DATA 0000ea97 00000000
sprintf11_DATA FAR_DATA 0000ea97 00000000
fprintf11_DATA FAR_DATA 0000ea97 00000000
fprtf11_DATA FAR_DATA 0000ea97 00000000
efgfmt11_DATA FAR_DATA 0000ea97 00000000
_NULL BEGDATA DGROUP 0000f000 00000020
_AFTERNULL BEGDATA DGROUP 0000f020 00000002
CONST DATA DGROUP 0000f024 00002628
CONST2 DATA DGROUP 0001164c 000001d4
_DATA DATA DGROUP 00011820 00000674
XIB DATA DGROUP 00011e94 00000000
XI DATA DGROUP 00011e94 00000030
XIE DATA DGROUP 00011ec4 00000000
YIB DATA DGROUP 00011ec4 00000000
YI DATA DGROUP 00011ec4 0000000c
YIE DATA DGROUP 00011ed0 00000000
DATA DATA DGROUP 00011ed0 00000000
DATA32 DATA DGROUP 00011ed0 0000011c
CONST32 CONST DGROUP 00011fec 00000000
_BSS BSS DGROUP 00011ff0 00005218
BSS32 BSS DGROUP 00017208 00000000
STACK STACK DGROUP 00017210 00004000
etc…
Note that 2^16 = 64K => 0x00010000 < 0x00017210+0x00004000.
Thank you,
Amit Sanyal
asanyal@tamu.edu