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 -lfoo -lm -lc

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 Itanium-based systems, the +[no]concatrpath option enables or disables the concatenation of search paths specified by multiple +b path_list at link time.

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 -b output/lib1.c -o output/lib1.sl

$ cat input/lib1.c #include <stdio.h> void lib1() {

printf("lib1 in input\n");

}

$ cc -b input/lib1.c -o input/lib1.sl

$ cat main.c #include <stdio.h> void lib1();

int main() { lib1(); return 0;

}

$ cc -c main.c

If +concatrpath is specified, the linker record all the +b pathlist entries, as follows:

$ ld main.o -lc +b output +b input +concatrpath -L input -l1 $ a.out

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 -lc +b output +b input -L input -l1 $ a.out

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)