delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/07/08:48:13

Message-Id: <4.2.0.58.20001107143830.00a84c60@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: Tue, 07 Nov 2000 14:47:39 +0100
To: djgpp 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
In-Reply-To: <200009181903.PAA22034@delorie.com>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv 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 !




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