HP 3000 Manuals

Loading a Shared Global Data Program File or XL [ Technical Addendum for HP Link Editor/iX ] MPE/iX 5.0 Documentation


Technical Addendum for HP Link Editor/iX

Loading a Shared Global Data Program File or XL 

The loader is responsible for binding code and data imports and exports
at load time.  The loader will:

   *   Set up DP according to the initialization pointers.

   *   Set up LP and XRT entries according to LST import records.

   *   Initialize the DXRT entries with addresses at load time according
       to the loader fixups and LST import records.

   *   Implement a new binding scheme for data that allows program file
       global data exports to bind XL data imports and vice versa.

   *   Copy the data exports from the file's export list.  Select and
       store a unique instance of the data export into the loader's
       Process Data Dictionary (PDD).


NOTE Code binding has not changed. XLs can bind code imports in a program file but program file code exports will not bind XL code imports.
Loader Binding Rules The loader binds data symbols according to these binding rules: * Data Universals in program files have precedence over definitions in XLs for that symbol. This is because the precedence rule is observed from left to right and the program file is always first. * For Storage Requests, the largest one encountered has precedence over all others, either in a program file or XL. * Initialized data (Data Universals) take precedence over uninitialized data (Storage Requests). * The most privileged data takes precedence. * Memory resident data takes precedence over non-memory resident data. * XL Data Universals are selected on a first-seen basis. If the loader loads a module that has a definition for foo and there is no other definition for foo in an already loaded module or if there is a Storage Universal definition in an already loaded module, those definitions take precedence over all others. All imports for foo will bind to the one just loaded. Violation of any of the above rules for any data symbol results in a failed load. The precedence is established for each distinct data symbol only once per process. Therefore, libraries loaded dynamically, through the HPGETPROCPLABEL intrinsic, are subject to the same rules as static XLs (XLs specified at link time). Compatibility Shared global data XLs and program files are not backward compatible and do not run on older operating systems. Even if you use RLs during the link and your make script has not changed, the loader will not load the program file or XL if there are any data exports or imports. To determine if a program file or XL contains shared data, use the LISTPROG or LISTXL command appropriately and check the SHARED DATA header. Program files, object files, RLs, and XLs compiled with the 3-instruction compiler option are not backward compatible and do not run on older operating systems, even if they do not import or export any data. Note that program files and XLs created on older systems can be run on the shared global data operating system. Relinking is not required for the program to run.
NOTE POSIX programs must be recompiled if they contain the header files <stdio.h> and <direct.h>. If a program contains a direct or indirect reference to __file, it must be recompiled. The macros _file, _bufend, and fileno contain references to __file
Linking with Compatibility Mode Files The Link Editor does not allow users to share data when linking with compatibility mode files. For example, if octcomp.pub.sys is invoked and LKSHAREDATA is set to true, the Link Editor issues an error message and aborts the link. Refer to "Diagnostic Messages" for the error message.


MPE/iX 5.0 Documentation