Mail Archives: djgpp-workers/2000/11/08/04:06:17
I still have the same problem about the linker filling the executable
with garbage
when using stabs, but I have now also a very simple C example for it.
Please note that I do use the new version of the DJGPP binutils 2.10 for
this test.
Two source files:
/* >>>>>>>>>test.c>>>>>>>>>>> */
extern int main2();
int
main ()
{
double b;
b = 3.5;
printf("B is %f\n",b);
main2();
return 0;
}
/* >>>>>>>end of test.c>>>>>>>>>> */
/* >>>>>>>>>test2.c>>>>>>>>>>> */
int
main2 ()
{
double b;
b = 3.5;
printf("B is %f\n",b);
return 0;
}
/* >>>>>>>end of test2.c>>>>>>>>>> */
On win95 I do the following:
1) gcc -c -gstabs test2.c
This produces test2.o file
2) gcc -o test.exe -gstabs test.c test2.o
This produces test.exe
3) gcc -o test2.exe -gstabs test.c test2.o
This produces test2.exe
4) cmp test.exe test.exe
This gives out: test.exe and test2.exe differ:char 181499,line 190
The offset of the difference corresponds to the end of the stabstr section,
so my guess is that the alignment done after this section (stabstr) which
is the last
section of these executable still in not zeroed correctly.
The problem is that I tried to look at binutils sources, but didn't really
understand where this alignment is done !
After other tries, it seems that it is even possible to get the same
problem with only
one object file having stabs info.
PS: I sent this to the djgpp list (news mirror) by error first.
Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller AT ics DOT u-strasbg DOT fr
Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99
- Raw text -