pTAL Reference Manual (H06.08+)

Compiling and Linking pTAL Programs
HP pTAL Reference Manual523746-006
16-12
Creating a Dynamic Linked Library (DLL)
Creating a Dynamic Linked Library (DLL)
To create a dynamic-link library (DLL) from pTAL source files, compile the pTAL source
files by using the CALL_SHARED directive (in the Guardian environment) or the
-call_shared flag (in the Windows environment), and then use ld or eld to link the
pTAL source files through the -shared option.
The compiler does not automatically export program names. You must specify
-export_all or -export to the linker.
Compiling With Global Data Blocks
When you compile modules of a program separately or link pTAL code with code
written in other languages, the linking process relocates some of your global data.
Topics:
Declaring Global Data on page 16-12
Allocating Global Data Blocks on page 16-15
Address Assignments on page 16-15
Sharing Global Data Blocks on page 16-16
Declaring Global Data
You can declare blocked and unblocked global data (variables, LITERALs, and
DEFINEs).
Blocked global data declarations are those appearing within BLOCK declarations.
BLOCK declarations let you group global data declarations into named or private
blocks. Named blocks are shareable among all compilation units in a program. The
private block is private to the current compilation unit. If you include a BLOCK
declaration in a compilation unit, you must assign an identifier to the compilation unit
by using a NAME declaration.
Unblocked global data declarations are those appearing outside a BLOCK declaration.
Such declarations are also relocatable and shareable among all compilation units in a
program.
If you do not use the BLOCKGLOBALS directive, then all separate compilations must
specify exactly the same list of unblocked global data declarations.
If present in a compilation unit, global declarations must appear in the following order:
1. NAME declaration
2. Unblocked global data declarations
3. BLOCK declarations
4. PROC declarations