HP C/aC++ for PA-RISC Software manual Linker Options, Minshared, +nostl, +Onolibcalls=, Epsym

Models: C/aC++ for PA-RISC Software

1 230
Download 230 pages 50.97 Kb
Page 50
Image 50

-L directory

-L directory

The directory parameter is the HP-UX directory where you want the linker to search for libraries your program uses before searching the default directories.

The -L directory option causes the linker to search for libraries in directory in addition to using the default search path.

See -lnameoption for default search path.

The -Loption must precede any -lnameoption entry on the command line; otherwise -Lis ignored. This option is passed directly to the linker.

Example:

The following example compiles and links prog.C and directs the linker to search the directories and /project/libs for any libraries that prog.C uses (in this case, mylib1 and mylib2).

aCC -L/project/libs prog.C -lmylib1 -lmylib2

-minshared

-minshared

The -minsharedoption indicates that the result of the current compilation is going into an executable file that will make minimal use of shared libraries. This option is equivalent to -exec-Bprotected.

+nostl

+nostl

By eliminating references to the standard header files and libraries bundled with HP aC++, the +nostl option allows experienced users full control over the header files and libraries used in compilation and linking of their applications, without potential complications that arise in mixing different libraries.

NOTE: Complete understanding of the linking process and the behavior of the actual (third party) libraries linked with the application is essential to avoid link or runtime failures.

For more information on shared libraries, see “Creating and Using Libraries” (page 175).

+Onolibcalls=

+Onolibcalls=function1,function2,...

This option allows you to turn off libcall optimizations (inlining or replacement) for calls to the listed functions. This option overrides system header files.

Linker Options

You can specify the following linker options on the compiler command line:

-e epsym

-e epsym

Using the -e epsym option sets the default entry point address for the output file to be the same as the symbol epsym. This option only applies to executable files. It does not work if epsym=xec.

-n

-n

The -noption causes the program file produced by the linker to be marked as sharable.

50 Command-Line Options

Page 50
Image 50
HP C/aC++ for PA-RISC Software manual Linker Options, Minshared, +nostl, +Onolibcalls=, Epsym