PRB: Module Relocation Fixups in Shared Sections Cause Problem

This article was previously published under Q137235
This article has been archived. It is offered "as is" and will no longer be updated.
If a shared section in a 32-bit PE module contains relocation fixups, thosefixups are applied to all instances of that shared section. This impliesthat all instances of a module with such a section must be loaded at themodule's preferred image base; otherwise, the resulting relocated valueswill be invalid. This is true in both Windows 95 and Windows NT.
Because an explicitly shared section shares the same physical pages withall instances of that module, fixups that are applied in a second orsubsequent instance of the module overwrite the values from the firstinstance. The resulting values will be invalid for either one or allinstances.
Do not place relocatable values in a shared section. A module can be forcedto be non-relocatable by removing fixup records, although this may resultin load failures for that module if it can't be loaded at its preferredaddress.
This behavior is by design.
An example of something that causes a relocation fixup is a pointer in ashared section. Storing hInstance variables in a shared section is another.
4.00 Windows 95 win95fest

Article ID: 137235 - Last Review: 12/29/2014 10:46:09 - Revision: 1.1

Microsoft Platform Software Development Kit-January 2000 Edition

  • kbnosurvey kbarchive KB137235