configuration:
*  openssl 1.0.0.e
*  Win64, DS2010 toolchain
*  static library
*  default (using asm modules) configuration
 
When built in above configuration, a linking application will crash in
c-runtime startup code (i.e. before reaching main()).
This is due to some linker magic which causes an initialization routine
in the asm cpuid code to be run before user code is executed.
 
I have traced the origin of the problem to
openssl-1.0.0e\crypto\perlasm\x86_64-xlate.pl
which delares a section which contains a function pointer to the init
routine.
 
The alignment of that section is incorrect for x64, and specifies DWORD
(32bit) rather than 8-byte (64bit) alignment.
 
Changing line 558 from:
$v.=" READONLY DWORD";
to:
$v.=" READONLY ALIGN(8)";
 
will correct the problem.
 
Note:  it is possible by sheer luck to have a build an application that
will coincidentally have that function pointer correctly aligned.  Also,
'no-asm' builds will operate correctly.
 
If you would, please include this change in the next release.
 
-David Lemley

Title: Message
configuration:
*  openssl 1.0.0.e
*  Win64DS2010 toolchain
*  static library
*  default (using asm modules) configuration
 
When built in above configuration, a linking application will crash in c-runtime startup code (i.e. before reaching main()).
This is due to some linker magic which causes an initialization routine in the asm cpuid code to be run before user code is executed.
 
I have traced the origin of the problem to
openssl-1.0.0e\crypto\perlasm\x86_64-xlate.pl
which delares a section which contains a function pointer to the init routine.
 
The alignment of that section is incorrect for x64, and specifies DWORD (32bit) rather than 8-byte (64bit) alignment.
 
Changing line 558 from:
$v.=" READONLY DWORD";
to:
$v.=" READONLY ALIGN(8)";
 
will correct the problem.
 
Note:  it is possible by sheer luck to have a build an application that will coincidentally have that function pointer correctly aligned.  Also, 'no-asm' builds will operate correctly.
 
If you would, please include this change in the next release.
 
-David Lemley

Reply via email to