PRB: Module Relocation Fixups in Shared Sections Cause Problem

Last reviewed: September 27, 1995
Article ID: Q137235
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)

SYMPTOMS

If a shared section in a 32-bit PE module contains relocation fixups, those fixups are applied to all instances of that shared section. This implies that all instances of a module with such a section must be loaded at the module's preferred image base; otherwise, the resulting relocated values will be invalid. This is true in both Windows 95 and Windows NT.

CAUSE

Because an explicitly shared section shares the same physical pages with all instances of that module, fixups that are applied in a second or subsequent instance of the module overwrite the values from the first instance. The resulting values will be invalid for either one or all instances.

RESOLUTION

Do not place relocatable values in a shared section. A module can be forced to be non-relocatable by removing fixup records, although this may result in load failures for that module if it can't be loaded at its preferred address.

STATUS

This behavior is by design.

MORE INFORMATION

An example of something that causes a relocation fixup is a pointer in a shared section. Storing hInstance variables in a shared section is another.


Additional reference words: 4.00 Windows 95
KBCategory: kbprg kbprb
KBSubcategory: BseMm


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.