X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=JcMQU9Ay9Zdg7bbfCWYTaW/FTekEFY4ZDNH4XXz0iP4=; b=fZuPFUQd7InExy5bbkDJx5G5cFOyCPSdvWyfviDPMugvi3IO/fqBveYxFHd8Sf7x1D nJPEs1GWUAW8iIz4pSIcgHE7w29HywzqWj5JvZUu7ta1lHM+6u/CUJUxrjQzZphwHIpo lc3JpR62zF2Q9BbqkmuCSssMiN3s3NweE8DOI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=I+oPSdTJYlvLvJFyDhW3RenOoKk7u9Y6r9WJyeKusj7w9rLri/N5Tmtb0OvGh8ImbU BkHMlARCmK8NsZTSWHcOKSBXlUeWuxVRxwgZRwJGuzqz8jkTS2SitYYe7hxkfuxnZKUT f7c7V1Ovdu7GbbaFxRsBCjQgDaXY/mPxyLJbc= Message-ID: <89da6560807291624he0cb2d1u696542e552887e8d@mail.gmail.com> Date: Tue, 29 Jul 2008 16:24:36 -0700 From: "Lael Jones" To: djgpp AT delorie DOT com Subject: djgpp v2 : Control register access segfaults MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_50578_25458136.1217373876965" Reply-To: djgpp AT delorie DOT com ------=_Part_50578_25458136.1217373876965 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I'm upgrading my application from djgpp v1 to djgpp v2 and am seeing a seg fault in the debug build when the application tries to access (read or write) control registers (specifically CR4). The inline assembly I am using is: // Enable SSE instructions via OSFXSR (bit 9 of CR4). __asm__ __volatile__ ( " movl %%cr4, %%eax orl $0x00000200, %%eax movl %%eax, %%cr4 " : /* output */ : /* input */ : /* modified */ "%eax" ); The seg fault always occurs on "movl %%cr4, %%eax". The exact same code executes without the seg fault in a release build ("-O2"). The relevant source file is compiled with "-ggdb -O0", however due to the size of the executable I have stripped the debug symbols using "strip -g". All libraries are statically linked. Are there any known issues/changes to djgpp that would cause this? I searched both google and mailing list archives and wasn't able to find any reference to this issue. Thanks Lael ------=_Part_50578_25458136.1217373876965 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Hello,
 
I'm upgrading my application from djgpp v1 to djgpp v2 and am seeing a seg fault in the debug build when the application tries to access (read or write) control registers (specifically CR4).  The inline assembly I am using is:
 
   // Enable SSE instructions via OSFXSR (bit 9 of CR4).
   __asm__ __volatile__
   (
      "
         movl %%cr4, %%eax
         orl  $0x00000200, %%eax
         movl %%eax, %%cr4
      "
      :  /* output */
      :  /* input */
      :  /* modified */
      "%eax"
   );
 
The seg fault always occurs on "movl %%cr4, %%eax".  The exact same code executes without the seg fault in a release build ("-O2").  The relevant source file is compiled with "-ggdb -O0", however due to the size of the executable I have stripped the debug symbols using "strip -g".  All libraries are statically linked.
 
Are there any known issues/changes to djgpp that would cause this? 
 
I searched both google and mailing list archives and wasn't able to find any reference to this issue.

Thanks

 
Lael

------=_Part_50578_25458136.1217373876965--