[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] Window ansi crash debug output
From: |
Camm Maguire |
Subject: |
Re: [Gcl-devel] Window ansi crash debug output |
Date: |
30 Jan 2004 12:11:36 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Hi Mike, and thanks for your *very helpful* debugging work! I think
we can see the problem now. relocate_symbols is relocating .bss
variables to the start of the .text section (i.e. the code) instead of
to its own section. .bss is not read in, but space is allocated for
it separately. On my Linux box, it is put at the end, which I follow
here in the patch below. Hopefully, the textsize, datasize, and
bsssize variables are properly rounded by the current read in
procedure. We also should at some point cleanup hacks like the
following:
/* What does this mean? */
the_start = start_address
= malloc ( datasize + textsize + bsssize + extra_bss + 0x80000 );
What an apparent waste of space. In any case, I'm only suggesting a
minimal solution now to see if we can get it right with a baby step.
Here are the offending lines from your debug output:
fasload: c:/cvs/head/gcl/unixport/../pcl/pcl_dfun.o, number of symbols: 648
string table length = 3056
Code size 71920, read 71536 bytes of text + data into memory at the_start
(1046d000)
fasload c:/cvs/head/gcl/unixport/../pcl/pcl_dfun.o: memory->cfd.cfd_start
1046d000, memory->cfd.cfd_start + memory->cfd.cfd_size 1047e8f0
relocate_symbols: am ignoring a scnum -2
relocate_symbols: type 3 (BSS_NSCN) new value will be start 1046d000 for sym
_Lclptr177,
relocate_symbols: type 3 (BSS_NSCN) new value will be start 1046d000 for sym
_Lclptr178,
relocate_symbols: type 3 (BSS_NSCN) new value will be start 1046d000 for sym
_Lclptr216,
BTW, you are missing one closure pointer (not here, in your
pcl_braid.o file) compared to my compiled pcl code, and I think it is
this one:
static void LnkT174(ptr) object *ptr;{ call_or_link_closure(VV[174],(void
**)(void *)&Lnk174,(void **)(void *)&Lclptr174);} /* SETF PCL
SLOT-VALUE-USING-CLASS */
We've defined the #+setf feature/macro recently, helping greatly with
the ansi test failures. At some point you might want to check that it
is on for Windows. But before all else, try your debugging with this
new patch:
Index: sfasl.c
===================================================================
RCS file: /cvsroot/gcl/gcl/o/sfasl.c,v
retrieving revision 1.16
diff -u -b -r1.16 sfasl.c
--- sfasl.c 28 Jan 2004 07:21:52 -0000 1.16
+++ sfasl.c 30 Jan 2004 16:59:42 -0000
@@ -76,6 +76,7 @@
struct syment *s_symbol_table;
char *s_start_address;
char *s_start_data;
+ char *s_start_bss;
char *s_my_string_table;
int s_extra_bss;
char *s_the_start;
@@ -315,6 +316,7 @@
memory->cfd.cfd_start =
alloc_contblock ( memory->cfd.cfd_size );
sfaslp->s_start_data = start_address + textsize;
+ sfaslp->s_start_bss = start_address + textsize + datasize;
END_NO_INTERRUPT;
}
#else
@@ -323,6 +325,7 @@
= malloc ( datasize + textsize + bsssize + extra_bss + 0x80000 );
the_start = start_address = (char *) ( 0x1000 * ( ( ( (int) the_start +
0x70000) + 0x1000) / 0x1000 ) );
sfaslp->s_start_data = start_address + textsize;
+ sfaslp->s_start_bss = start_address + textsize + datasize;
#endif
dprintf(" Code size %d, ", datasize+textsize+bsssize + extra_bss);
if ( fseek ( fp, N_TXTOFF(fileheader), 0) < 0 ) {
@@ -598,6 +601,8 @@
unsigned int typ;
char *str;
char tem[SYMNMLEN +1];
+ int n_value=(int)start_address;
+
tem[SYMNMLEN]=0;
end =symbol_table + length;
for(sym=symbol_table; sym < end; sym++) {
@@ -615,16 +620,12 @@
case N_ABS : case N_TEXT: case N_DATA: case N_BSS:
#endif
#ifdef COFF
-# ifdef _WIN32
- case TEXT_NSCN:
- sym->n_value = (int)start_address;
- break;
- case DATA_NSCN:
- sym->n_value = (int)sfaslp->s_start_data;
- break;
- case BSS_NSCN:
-# else /* _WIN32 */
case TEXT_NSCN : case DATA_NSCN: case BSS_NSCN :
+#ifdef _WIN32
+ if (typ==DATA_NSCN)
+ n_value = (int)sfaslp->s_start_data;
+ if (typ==BSS_NSCN)
+ n_value = (int)sfaslp->s_start_bss;
#endif /* _WIN32 */
#endif /* COFF */
str=SYM_NAME(sym);
@@ -641,7 +642,7 @@
fprintf ( stderr, "(BSS_NSCN)");
break;
}
- fprintf ( stderr, " new value will be start %x for sym %s, \n",
start_address, str );
+ fprintf ( stderr, " new value will be start %x for sym %s, \n",
n_value, str );
#endif
#ifdef AIX3
if ( N_SECTION(sym) == DATA_NSCN
@@ -649,7 +650,7 @@
&& allocate_toc(sym) )
break;
#endif
- sym->n_value = (int)start_address;
+ sym->n_value = n_value;
break;
case N_UNDEF:
str=SYM_NAME(sym);
=============================================================================
Take care,
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah