| 1 |
GC on EWS4800 |
| 2 |
------------- |
| 3 |
|
| 4 |
1. About EWS4800 |
| 5 |
|
| 6 |
EWS4800 is a 32/64-bit workstation. |
| 7 |
|
| 8 |
Vendor: NEC Corporation |
| 9 |
OS: UX/4800 R9.* - R13.* (SystemV R4.2) |
| 10 |
CPU: R4000, R4400, R10000 (MIPS) |
| 11 |
|
| 12 |
2. Compiler |
| 13 |
|
| 14 |
32-bit: |
| 15 |
Use ANSI C compiler. |
| 16 |
CC = /usr/abiccs/bin/cc |
| 17 |
|
| 18 |
64-bit: |
| 19 |
Use the 64-bit ANSI C compiler. |
| 20 |
CC = /usr/ccs64/bin/cc |
| 21 |
AR = /usr/ccs64/bin/ar |
| 22 |
|
| 23 |
3. ELF file format |
| 24 |
*** Caution: The following information is empirical. *** |
| 25 |
|
| 26 |
32-bit: |
| 27 |
ELF file has a unique format. (See a.out(4) and end(3C).) |
| 28 |
|
| 29 |
&_start |
| 30 |
: text segment |
| 31 |
&etext |
| 32 |
DATASTART |
| 33 |
: data segment (initialized) |
| 34 |
&edata |
| 35 |
DATASTART2 |
| 36 |
: data segment (uninitialized) |
| 37 |
&end |
| 38 |
|
| 39 |
Here, DATASTART and DATASTART2 are macros of GC, and are defined as |
| 40 |
the following equations. (See include/private/gcconfig.h.) |
| 41 |
The algorithm for DATASTART is similar with the function |
| 42 |
GC_SysVGetDataStart() in os_dep.c. |
| 43 |
|
| 44 |
DATASTART = ((&etext + 0x3ffff) & ~0x3ffff) + (&etext & 0xffff) |
| 45 |
|
| 46 |
Dynamically linked: |
| 47 |
DATASTART2 = (&_gp + 0x8000 + 0x3ffff) & ~0x3ffff |
| 48 |
|
| 49 |
Statically linked: |
| 50 |
DATASTART2 = &edata |
| 51 |
|
| 52 |
GC has to check addresses both between DATASTART and &edata, and |
| 53 |
between DATASTART2 and &end. If a program accesses between &etext |
| 54 |
and DATASTART, or between &edata and DATASTART2, the segmentation |
| 55 |
error occurs and the program stops. |
| 56 |
|
| 57 |
If a program is statically linked, there is not a gap between |
| 58 |
&edata and DATASTART2. The global symbol &_DYNAMIC_LINKING is used |
| 59 |
for the detection. |
| 60 |
|
| 61 |
64-bit: |
| 62 |
ELF file has a simple format. (See end(3C).) |
| 63 |
|
| 64 |
_ftext |
| 65 |
: text segment |
| 66 |
_etext |
| 67 |
_fdata = DATASTART |
| 68 |
: data segment (initialized) |
| 69 |
_edata |
| 70 |
_fbss |
| 71 |
: data segment (uninitialized) |
| 72 |
_end = DATAEND |
| 73 |
|
| 74 |
-- |
| 75 |
Hironori SAKAMOTO |
| 76 |
|
| 77 |
|
| 78 |
When using the new "configure; make" build process, please |
| 79 |
run configure with the --disable-shared option. "Make check" does not |
| 80 |
yet pass with dynamic libraries. The reasons for that are not yet |
| 81 |
understood. (HB, paraphrasing message from Hironori SAKAMOTO.) |