IBM Support

Ensuring the correct writeable static area (WSA) is used when an LE program is loaded from an assembler module.

Question & Answer


Question

We're getting branches to strange and unexpected functions in a program loaded by an assembler module, the assembler module itself having been loaded from the LE mainline. It appears that the writeable static (WSA) for the new load module is not being initialized. How should I go about getting the WSA initialized?

Cause

Using the LOAD macro simply returns a pointer to the new executable, and branching through the resulting pointer doesn't switch WSA contexts, leaving the mainline's WSA as the current WSA.

In the absence of the WSA switch, the new executable will use its WSA offsets within the mainline's WSA, leading to strange problems if not outright abends.

Answer

Although the documentation omits mention of it, the CEEFETCH macro returns a pointer to a function descriptor that you can call using CEEPCALL to transfer control to a separately loaded executable AND have the WSA switch take place.

Note that you generally need to avoid calling CEEFETCH more than once for a module. Although reentrant code won't actually be loaded again, it does create a new instance of the module as far as the WSA is concerned. You need to keep a pointer to the returned function descriptor around for as long as you'll be calling the module.

The CEEFETCH documentation notes that "If MF=I or MF=L are specified, you must specify TOKEN" but the macro doesn't generate an MNOTE for it if omitted; CEEBFTCH will 0C4 later on the missing TOKEN.

Related Information

[{"Product":{"code":"SWG90","label":"z\/OS"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"568819805 - LE C++ RUN TIME LIBRARIES (LE\/RTL)","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"N\/A","Edition":"","Line of Business":{"code":"LOB56","label":"Z HW"}}]

Historical Number

66086.487.000

Document Information

More support for:
z/OS

Software version:
N/A

Operating system(s):
z/OS

Document number:
700293

Modified date:
03 September 2021

UID

isg3T1012049

Manage My Notification Subscriptions