The genso command generates shared objects.
Syntax
/usr/bin/genso
[options] [files] |
options
genso accepts some of the options used for the POSIX C compiler; other options are derived from the ld command used on UNIX systems. |
Adds |
Only in connection with The following specifications are possible:
stands for TSOS
(period) stands for the user ID under which the application is running
if a BS2000 user ID is to be explicitly specified. The user ID must then be written in the environment variable |
libxxx.a or libxxx.so will be used to generate a shared object. Which type of library is actually used depends on the actual use of |
Only in connection with |
Only in connection with |
The name of the shared object to be generated. The shared object is stored under this name in the current directory. The extension of the file name should be .so; the .so file extension is not added automatically to the file name. To avoid misunderstandings, the suffixes .o and .a are rejected. |
From now on, PLAM libraries are processed. To switch to ar or so libraries, |
If PLAM libraries have been processed, then ar libraries or so libraries will be processed from now on. |
Der Inhalt des Shared Object wird auf stdout ausgegeben. Ist der Dateiname kein absoluter oder relativer Pfad, dann wird die Datei in den mit der Umgebungsvariablen LD_LIBRARY_PATH spezifizierten Verzeichnissen oder in /usr/lib gesucht. Bei der Anwendung auf eine Datei im aktuellen Verzeichnis ist also gegebenenfalls ein ./ voranzustellen, falls dieses Verzeichnis nicht in der Umgebungsvariablen LD_LIBRARY_PATH spezifiziert ist.
The contents of the shared object are output to stdout. If the file name is not an absolute or relative path, the file is searched for in the directories specified with the environment variable LD_LIBRARY_PATH or in /usr/lib. When applied to a file in the current directory, a ./ may need to be prefixed if this directory is not specified in the environmental variable LD_LIBRARY_PATH.
|
Specifies the programming language of the object to be loaded. Mixed objects are possible. Default value is |
When this option is given in the command line, static libraries (.a) have priority over dynamic libraries (.so). |
When this option is given in the command line, dynamic libraries (.so) have priority over static libraries (.a). |
Address resolution is effected when an object is loaded (via dlopen) and the sequence of resolving addresses is: (1) the loaded program a.out (2) all shared objects loaded before the actual object is loaded (RTLD_GLOBAL) (3) the currently loaded object
The resolution is effected in reverse order (3 - 2 - 1). |
files
Only file names with .o file extension can be used (or with the name suffix .so when the -S option is used). Executable files must be renamed if necessary. Files can only be specified after all options. |
Exit status
The following exit values are returned:
0 | Successful generation |
>0 | An error occurred |
File
In the directory in which the output will be generated, a directory is temporarily generated and will be deleted when the command terminates.
Environment
Directories for libraries are searched with the following priority:
directories contained in the variable LD_LIBRARY_PATH. If more than one directory is specified, the directories must be separated by colons (without blanks!).
directories defined by
–L
option.
Example 1
Four Shared Libraries have to be generated: libtest21.so, libtest22.so, libtest23.so and libtest24.so.
The o files test21.o, test22.o, test23.o and test24.o are located in the current directory.
The shared objects libtest23.so and libtest24.so only comprise the o files test23.o and test24.o respectively.
The library libtest22.so consists of test22.o and the dependent shared object libtest24.so; the library libtest21.so consists of test21.o and the dependent shared objects libtest22.so and libtest23.so.
The following calls of genso are required to generate the shared objects:
genso -o libtest24.so test24.o genso -o libtest23.so test23.o genso -o libtest22.so -l test24 test22.o genso -o libtest21.so -l test22 -l test23 test21.o
With the option –S
, you can view the contents of a shared object.
$ genso -S low ./libtest21.so analysis of shared object ./libtest21.so shared object ./libtest21.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/test/reihentest/test21.o dep. shared object libtest22.so (/home/bach/dll/test/reihentest/libtest22.so) dep. shared object libtest23.so (/home/bach/dll/test/reihentest/libtest23.so) option: -X lang=c
If you also wish to view the contents of the dependent libraries, –S high
must be specified.
$ genso -S high ./libtest21.so analysis of shared object ./libtest21.so shared object ./libtest21.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/test/reihentest/test21.o dep. shared object libtest22.so (/home/bach/dll/test/reihentest/libtest22.so) dep. shared object libtest23.so (/home/bach/dll/test/reihentest/libtest23.so) option: -X lang=c analysis of shared object /home/bach/dll/test/reihentest/libtest22.so shared object /home/bach/dll/test/reihentest/libtest22.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/test/reihentest/test22.o dep. shared object libtest24.so (/home/bach/dll/test/reihentest/libtest24.so) option: -X lang=c analysis of shared object /home/bach/dll/test/reihentest/libtest24.so shared object /home/bach/dll/test/reihentest/libtest24.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/test/reihentest/test24.o option: -X lang=c analysis of shared object /home/bach/dll/test/reihentest/libtest23.so shared object /home/bach/dll/test/reihentest/libtest23.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/test/reihentest/test23.o option: -X lang=c
Example 2
A shared object with the name libp1.so must be generated from the following components:
- from the member UNTEST1.O from the PLAM library $BACH.DL.LIB
- from all members of the ar library libar.a and the o file file1.o.
The generation command is called up under the ID $BACH, and has the following format:
genso -o libp1.so -B plam -L . -lDL.LIB -m UNTEST1.O -B ar -L . -l ar file1.o
Here, -B plam -L . -lDL.LIB
indicates that DL.LIB is a PLAM library located in the user ID under which genso is called up.
If you view the contents of libp1.so, you will see:
$ genso -S low ./libp1.so analysis of shared object ./libp1.so shared object ./libp1.so consists of Grossmodul ofile_GM_.o built of objectmodule /home/bach/dll/newcommands/file1.o arlibrary /home/bach/dll/newcommands/libar.a with elements objectmodule arfile1.o objectmodule arfile2.o plam library dl.lib with elements UNTEST1.O option: -X lang=c