The following link editor options are not evaluated if one of the -c
, -E
, -M
or -P
options are specified (terminate the compiler run after compilation or after the preprocessor run, see "Options for selecting compilation phases").
-B extended_external_names
-B short_external_names
This option is required if the program to be linked is to run on very old systems. LLMs with long names (EEN) cannot be processed on systems with BS2000/OSD versions 1 to 3 or the BLSSERV product with version less than 2.0. For such systems, the generated element must have an LLM format 1.
EENs, i.e. untruncated external C++ symbols are generally contained in modules that were generated with the compiler in mode C++ 2017, C++ 2020 or C++ V3.
Untruncated external C symbols are generated only if the -K c_names_unlimited
option is specified at compilation (see "Options for controlling object generation").
If this is the case, even external C symbols are not truncated to 32 bytes by the compiler.
Modules with EENs are stored by the compiler in LLM Format 4. The modules of the C++ libraries and of the CRTE runtime systems used in mode C++ 2017, C++ 2020 or C++ V3 are also provided in LLM Format 4.
If the modules generated by the compiler do not include any EENs, i.e. are in LLM Format 1, this option has no effect, since the link editor always generates LLM Format 1 in accordance with the input format in this case.
By default, the link editor generates LLM Format 4. The EENs remain in the result module without being truncated. LLMs in Format 4 can be partially linked, i.e. first linked with unresolved external references to EENs and then processed further as desired by means of the link editor.
-B extended_external_names
This entry is supported for compatibility reasons only.
-B short_external_names
This entry is needed if the link editor is to generate LLM Format 1.
In this case, all symbols with long names (EEN) must be satisfied. There is no EEN in the generated LLM. If an open reference remains here, it remains open in the long run and cannot be satisfied subsequently.
Summary of generated LLM formats
Input format | Option -B | Output format |
LLM 1 | no entry / extended_external_names / | LLM 1 |
LLM 4 (EEN) | no entry / extended_external_names | LLM 4 |
short_external_names | LLM 1 |
-d y
-d n
-d compl
This option affects linking the C runtime system.
By default, i.e. if the option is either not specified or -d y
is specified, a RESOLVE for the standard C library libc
.a
is issued to the SYSLNK.CRTE.PARTIAL-BIND library. Instead of the complete C runtime system being linked in, only a connection module is linked that satisfies all unresolved external references to the C runtime system. The C runtime system itself is loaded dynamically at runtime, either from class 4 memory if the C runtime system has been preloaded, or from the SYSLNK.CRTE.
If -d n
is specified, the C runtime system is linked in completely from the SYSLNK.CRTE.
The complete partial bind method of the CRTE is supported with the -d compl
option. To accomplish this the SYSLNK.CRTE.COMPL library is linked in.
You will find a detailed description of the complete partial bind method in the "CRTE" [5] manual.
In the mode C++ V3 the special library SYSLNK.CRTE.CPP-COMPL is linked instead of the standard libraries SYSLNK.CRTE.RTSCPP and SYSLNK.CRTE.STDCPP. This library is also used instead of SYSLNK.CRTE.TOOLS.
Note
The complete partial bind method is not supported in the CFRONT-C++ mode. The option -d compl
is reset to -dy
in this case.
In the modes C++2017 and C++ 2020 the "complete partial bind" technique is not supported. In this case, the -d compl
option is rejected with an error.
-K
arg1[,arg2...]
General input rules for the -K
-option can be found in section "Calling syntax and general rules".
The following entries are possible as arg arguments to control the link editor:
link_stdlibs
no_link_stdlibs
-K link_stdlibs
is the default setting and causes certain standard libraries to be automatically linked in (see also the
-l
option). This means that the corresponding -l
options are automatically set for these libraries:
Only with the
CC
command-l Cxx
in C++ 2017 and C++ 2020 mode-l Cstd
in C++ V3 mode-l C
in Cfront C++ modeAlways
-l c
If -K no_link_stdlibs
is specified, the above libraries are not linked in automatically. -K no_link_stdlibs
is set automatically, if a prelinked object file is generated with the -r
option (see "Link editor options").
-l
x
This option instructs the link editor to search the library named lib
x.a
for resolving external references via autolink. By default the link editor searches for the library in the following directories in the order given below:
The directories specified with
-L
Either the directories specified with the
-Y P
option (see "Link editor options") or the standard/usr/lib
directory.
-l
x falls into the category of operands and can also be specified with --
after options have been input (see also “Operands” (Calling syntax and general rules)).
The standard libraries of the C and C++ runtime system are not installed in the POSIX file system /usr/lib
directory, they are stored as PLAM libraries in BS2000.
Assignment of standard libraries -l
x to the BS2000 PLAM libraries:
x | Library name | Contents |
|
| Connection module for loading the C runtime system dynamically (default) |
| Separate modules for completely linking the C runtime system (with | |
| see | |
| see | |
| Cfront C++ runtime system | |
| Cfront C++ library for input/output and complex | |
| see c | |
| C++ V3 runtime system | |
| Standard C++ V3 library | |
| see c | |
see Cxx1 or Cxx2 | C++ 2017 or C++ 2020 library, according to option | |
| see c | |
| C++ 2017 library in library version 1 | |
| see c | |
| C++ 2017 or C++ 2020 library in library version 2 | |
|
| C++ V3 library Tools.h++ |
The link editor only resolves the unresolved external references from these PLAM libraries if the -l
x option is used and not if the path name is specified explicitly (e.g. /usr/lib/libRWtools.a
) using the file.suffix operand (see "Calling syntax and general rules")!
When calling the compiler in the C language modes, -lc
is implicitly added as the last -l option, when calling in Cfront-C++ mode the implicitly added option is -l C
, when calling in C++ V3 mode it is -l Cstd
and when calling in C++ 2017 or C++ 2020 mode it is -l Cxx
(does not apply to -K no_link_stdlibs
).
The order and position in which the -l
options and any object files (or source files from which the compiler generates object files) are specified in the command line is significant to the link process.
For example, the program would be linked correctly with the CC -v3-compatible test.c -l RWtools
command, but the CC -v3-compatible -l RWtools test.c
command would lead to an error.
-l BLSLIB
This option instructs the link editor to search PLAM libraries which were assigned with the BLSLIBnn (00 <=
nn <=
99) shell environment variable.
The environment variables must be supplied with the library names and exported with the POSIX export
command before the compiler is called. The libraries are searched in ascending order nn.
All libraries specified with BLSLIBxx are searched cyclically. They are processed by BINDER as if they had been specified as a list in one RESOLVE directive to the link editor.
-l BLSLIB
falls into the category of operands and can also be specified with --
after options have been input (see also “Operands (Calling syntax and general rules) ”).
Example
The library assigned with BLSLIB00 contains unresolved external references to the library assigned with BLSLIB01 and this in turn contains unresolved external references to the BLSLIB00 library (reverse references).
|
-L dir
The dir option can be used to specify an additional directory in which the link editor is to search for libraries specified with -l
options. By default, only the /usr/lib
directory is searched for the libraries. A directory specified with -L
is searched before the standard directory /usr/lib
or before the directories specified with the -Y P
option. The order in which the -L
options are specified in the command line determines the link editor search order.
This option only falls into the category of operands for the cc
, c11
and CC
commands and can therefore only be specified with --
after the options have been input (see also “Operands” (Calling syntax and general rules)).
-r
Several object files can be prelinked to form a single object file with this option. A prelinked object file is not executable, but contains the relocation information required to repeat a linkage run.
The following options are set implicitly when prelinking with -r
:
-K no_link_stdlibs
and
-B extended_external_names
. This means that the C/C++ standard libraries are not linked and that LLM Format 4 is generated in the case of long C and C++ names (EENs). The -K link_stdlibs
and -B short_external_names
options, if specified, are ignored. No instantiations by the prelinker are performed when generating a prelinked object file.Unresolved references do not cause error messages to be output.
The prelinked object file is given the name a.out
or the name specified with the -o
option. The object file can only be meaningfully further processed (linked) if the name of the prelinked object file is suffixed with .o
or with a suffix which can be defined with the -Y F
option (see "General options").
-s
Symbol table information is stripped from the output file. The sections with additional information for troubleshooting and with line numbers and associated offset information are also removed.
The option is ignored if debugging information for AID is simultaneously requested (-g
options). It is also ignored in all C++ modes as the symbol tables are required at runtime for global initialization. The option corresponds to the link editor SAVE-LLM SYMBOL-DICTIONARY=*NO directive.
-Y P,
dir1[:
dir2...]
Instructs the link editor to search for libraries in the directories specified with dir last. Without this option, the last directory to be searched is the standard directory /usr/lib
.
-z nodefs
This option is only supported when linking C programs (cc
, c11
, c89
). Specifying this option allows a C program to be linked in which all external references to the standard C library libc.a
remain unresolved, i.e. no RESOLVE is issued to the library
SYSLNK.CRTE.PARTIAL-BIND or SYSLNK.CRTE. The unresolved external references are resolved dynamically at runtime from the C runtime system which is preloaded into class 4 memory.
If this option is used, unresolved externals to user modules are ignored and not reported. Information on unresolved external references is only output when the program is loaded.
–z dup_ignore
–z dup_warning
–z dup_error
These options control the behavior of duplicates during linking.
–z dup_ignore
Duplicates are ignored during linking.This is the default.
–z dup_warning
Duplicates during linking result in a warning being issued.
–z dup_error
Duplicates during linking result in an error.
A program which contains duplicates cannot be executed in POSIX. It immediately returns with error code 127.
The compiler cannot specify any duplicates which are found by name. They are output in the message BLS0339 when the program is loaded in BS2000 interface (SDF) with /LOAD-EXECUTABLE-PROGRAM
.
The modules which contain the duplicates can be found using the BINDER listing (see -N binder, "Options for outputting listings and CIF information") and possibly also with the support program nm
.