On PA32 systems, double colon (::) refers to the location in which the libraries were found at link time. For example, the following linker command instructs the dynamic loader to search for libfoo, libm, and libc first in the current working directory (.), then in the directory /app/lib, and lastly in the location in which the libraries were found at link time (::).
$ ld /opt/langtools/lib/crt0.o +b .:/app/lib:: prog.o
NOTE: The double colon (::) feature is available only for PA32 systems.
Concatenating Search Paths Specified by Multiple +b path_list on PA64 and Integrity Systems
On PA64 systems and
If +noconcatrpath option is specified, only the path that is specified by the last +b path_list option on the command line is recorded. The default is + noconcatrpath
. The following example illustrates the use of +[no]concatrpath option with +b:
$ cat output/lib1.c #include <stdio.h> void lib1() {
printf("lib1 in output\n");
}
$ cc
$ cat input/lib1.c #include <stdio.h> void lib1() {
printf("lib1 in input\n");
}
$ cc
$ cat main.c #include <stdio.h> void lib1();
int main() { lib1(); return 0;
}
$ cc
If +concatrpath is specified, the linker record all the +b pathlist entries, as follows:
$ ld main.o
lib1 in output
If +noconcatrpath is specified (or if +[no]concatrpath options are not specified), the linker records only the last +b pathlist entry, as follows:
$ ld main.o
lib1 in input
The Path List
Whether specified as a parameter to +b or set as the value of the SHLIB_PATH environment variable, the path list is simply one or more path names separated by colons (:), just like the syntax of the PATH environment variable. An optional colon can appear at the start and end of the list.
Absolute and relative path names are allowed. Relative paths are searched relative to the program's current working directory at run time.
Remember that a shared library's full path name is stored in the executable. When searching for a library in an absolute or relative path at run time, the dynamic loader uses only the base name of the library path name stored in the executable. For instance, if a program is linked with
42 Determining How to Link Programs or Libraries (Linker Tasks)