Microsoft KB Archive/814781

= PRB: The SH3 Linker Does Not Default to 4096 Alignment =

Article ID: 814781

Article Last Modified on 8/18/2005

-

APPLIES TO


 * Microsoft Windows CE Platform Builder 4.1
 * Microsoft Office Keyboard

-



SYMPTOMS
When you try to run an SH3 application on Windows CE .NET version 4.1 or later, you may receive a &quot;Fatal Application Error&quot; message.



CAUSE
The project wizard in Windows CE Platform Builder 4.1 generates a default alignment of 1024 for SH3 applications, instead of 4096. SH3 projects that are built with an alignment of 1024 will not successfully run on Windows CE Platform Builder versions 4.1 and later versions.

The SH3 project wizard in eMbedded Visual C++ 4.0 SP1 generates a default alignment of 4096. Therefore, SH3 projects that are generated with eMbedded Visual C++ 4.0 SP1 function correctly on Windows CE Platform Builder versions 4.1 and later.



RESOLUTION
Use the linker option /ALIGN:4096 to specify a 4096 byte alignment.

The following are common scenarios where you have to specify this linker option when you want to run your SH3 application on Windows CE .NET 4.1:

Using Windows CE Platform Builder 4.1

 * If you create a new project, you must change the linker alignment from /align:1024 to /align:4096.
 * If you open a project (a .vcw file) that was created with eMbedded Visual C++ version 4.0 or earlier versions, you must specify the /align:4096 linker option.

Using eMbedded Visual C++
 If a new project is destined for Windows CE Platform Builder 4.1 and later versions, when you create a new project using eMbedded Visual C++ 4.0, you must specify the /align:4096 linker option. If you are using eMbedded Visual C++ 4.0 SP1 to open a project (a .vcw file) that was created with eMbedded Visual C++ 4.0 or earlier versions, you must specify the /align:4096 linker option. Compiling at the command line requires you to specify /align:4096 to overwrite the linker default of /align:1024.

For example, type the following at the command prompt (where  is the name of the file you want to compile):

clsh -Qsh3  /link /align:4096



In Windows CE Platform Builder 4.1
To change the linker option in Windows CE Platform Builder 4.1, follow these steps:
 * 1) Open your SH3 platform (.pbw file).
 * 2) On the FileView tab, select your project.
 * 3) From the Project menu, click Settings.
 * 4) On the Link tab, the /align:4096 linker option is specified in the Project Options box.

In eMbedded VC++ 4.0 Service Pack 1
To change the linker option in eMbedded VC++ 4.0 SP1, follow these steps:
 * 1) Open your SH3 project (.vcw file).
 * 2) From the Project menu, click Settings.
 * 3) On the Link tab, the /align:4096 linker option is specified in the Project Options box.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.



MORE INFORMATION
The SH3 project wizard in eMbedded VC++ 4.0 SP1 generates a default alignment of 4096. Therefore, SH3 projects that are generated with eMbedded VC++ 4.0 SP1 will function correctly on Windows CE Platform Builder versions 4.1 and later.

Windows CE Platform Builder version 4.0 and earlier versions use a default alignment of 1024 for their SH3 platform. Therefore, there are no compatibility issues between an SH3 application (created with eMbedded VC++ versions 4.0 and earlier) and versions of Windows CE .NET 4.0 and earlier.

This issue is also addressed in the release notes for Windows CE .NET 4.2.

Keywords: kbprb KB814781

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.