delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/08/04:06:17

Message-Id: <4.2.0.58.20001108100342.020479c0@ics.u-strasbg.fr>
X-Sender: muller AT ics DOT u-strasbg DOT fr
X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58
Date: Wed, 08 Nov 2000 10:06:37 +0100
To: djgpp-workers AT delorie DOT com
From: Pierre Muller <muller AT cerbere DOT u-strasbg DOT fr>
Subject: Binutils 2.10 update #2, garbage alignment problem still
present
Cc: "Mark E." <snowball3 AT bigfoot DOT com>
Mime-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

   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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019