Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
cobol(1) OSS Shell and Utilities Reference Manual
-l l Contains all functions required by the C language output of lex utility that
are not made available through the -l c operand.
-l y Contains all functions required by the C language output of yacc utility that
are not made available through the -l c operand.
-l gwc Contains the C runtime library for the Guardian environment, using the wide
data-model.
In the absence of flags that inhibit invocation of the Binder, such as -c, -E,orWno-
bind, cobol passes an -l c operand to the Binder as the last -l operand, causing the stan-
dard C library to be searched after all other object files and libraries are loaded.
Handling of Guardian Libraries
The cobol command tries to determine the type of a Guardian file from its content. Text input
files are assumed to be COBOL85 language source files.
The object file for a Guardian source file is named according to the following convention:
• The object file uses the same filename with the letter "o" appended to the end.
For example, the object file xyzo is generated from the source file xyz.
• If a valid filename cannot be generated using the rule above, a filename
returned from tmpnam is used, and a message informs the user of the new
filename.
Libraries residing in Guardian directories cannot be specified as -l operands because of
the naming convention. They can be specified in the desired order with -Wbind flags.
The default executable file in a Guardian file system is aout in the directory from
which cobol is invoked.
Differences Between Static and Dynamic Binding
In static binding, the Binder resolves references to library functions by binding into the program
the functions from a user library, such as libc.a. In dynamic binding, the Binder resolves refer-
ences to library functions by using information found in a shared runtime library, such as libc.so.
Final resolution of references are not done until run time. Dynamic binding produces smaller
program files and uses fewer system resources than static binding. By default, cobol performs
dynamic binding.
A shared library must have a file extension of .so. Such a file can either be an actual shared
library file created by the Binder or an OSS text file containing only one line of text in the form
"SRL=srlpath" where srlpath is the OSS pathname of the actual shared library file.
In dynamic binding, if a library is specified by an operand of the form llibrary, cobol searches for
afileliblibrary.so in a directory in the library search paths. If the file is found in the directory,
cobol issues the Binder command SET IMPORT LIBRARY srlpath
, where srlpath is
the path-
name of the actual shared library file. If the file is not found in the directory, cobol searches for a
file liblibrary.a in the same directory. If a file is found, cobol issues the Binder command
SELECT SEARCH libpath to perform a static binding of the library. If neither file is found, cobol
repeats the search for the library in the next directory in the library search paths.
In static binding, cobol only searches for liblibrary.a from directories in the library search paths.
Static libraries can be used for dynamic binding. The Binder resolves external references using
all the specified static libraries before using the shared runtime library. A program can only have
one shared runtime library. cobol issues warnings if more than one shared runtime library is
specified.
The standard C runtime library, libc.a or libc.so is used in dynamic binding only if no other
2−90 Hewlett-Packard Company 527188-021