Sun Studio 12: C User's Guide

A.1.11 Linking and Libraries Options

Table A–11 Linking and Libraries Options Table

Option  

Action  

-B

Specifies whether bindings of libraries for linking are static or dynamic.

-d

Specifies dynamic or static linking in the link editor.

-G

Passes the option to the link editor to produce a shared object rather than a dynamically linked executable.

-h

Assigns a name to a shared dynamic library as a way to have different versions of a library.

-i

Passes the option to the linker to ignore any LD_LIBRARY_PATH setting.

-L

Adds directories to the list that the linker searches for libraries.

-l

Links with object library libname.so, or libname.a.

-mc

Removes duplicate strings from the .comment section of the object file.

-mr

Removes all strings from the .comment section. Can also insert a string in that section of the object file.

-Q

Emits or does not emit identification information to the output file.

-R

Passes a colon-separated list of directories used to specify library search directories to the runtime linker.

-xMerge

Merges data segments into text segments.

-xcode

Specify code address space.

-xldscope

Controls the default scope of variable and function definitions to create faster and safer shared libraries.

-xnolib

Does not link any libraries by default

-xnolibmil

Does not inline math library routines.

-xstrconst

Inserts string literals into the read-only data section of the text segment instead of the default data segment.