Some options have been renamed in the new linker, some have remained the same, and others are no longer needed. Table 15-3 compares the SunOS release 4.x ld command to the Solaris 2.6 ld command.
The sections following Table 15-3 explain how certain linking tasks are affected by the option differences.
Table 15-3 Comparison of ld Options
SunOS release 4.x Option |
Solaris 2.6 Replacement |
Notes |
---|---|---|
-align datum |
-M mapfile |
Uses mapfile and distinct sections |
-assert definitions |
Default |
|
-assert nodefinitions |
-znodefs |
Issues a fatal error instead of a warning |
-assert nosymbolic |
-zdefs |
Issues a fatal error instead of a warning |
-assert pure-text |
-ztext |
Issues a fatal error instead of a warning |
-A name |
No replacement |
dlopen(3X) and dlclose(3X) can approximate this behavior |
-Bdynamic |
-Bdynamic |
Applies only to the inclusion of shared libraries; use -dy (the default) to build dynamically linked executables. See "Building Executables". |
-Bnosymbolic |
-zdefs |
|
-Bstatic |
-dn & -Bstatic |
The -dn option must be specified to completely eliminate the dynamic linker. Use -Bstatic in dynamic mode to include archive libraries. (Used as a toggle. See "Building Executables".) |
-Bsymbolic |
-Bsymbolic |
Also gets -assert nosymbolic with this option |
-d -dc -dp |
Default |
Use -b option in SVR4 to turn off |
-D hex |
-M mapfile |
mapfile contains different mechanisms to accomplish desired effect |
-e entry |
-e entry |
|
no -e |
-G |
Creates a shared object |
-lx[.v] |
-lx |
Only major number versioning of shared libraries is currently supported |
-Ldir |
-Ldir |
dir not recorded in executable; use -R option instead. |
-M |
-m |
|
-n |
Default |
SVR4 executable format compresses disk image as -n |
-N |
No replacement |
|
-o name |
-o name |
|
-p |
Default |
Can override with -M mapfile |
-r |
-r |
|
-S |
No replacement |
|
-s |
-s |
|
-t |
No replacement |
|
-T hex |
-M mapfile |
mapfile contains different mechanisms to accomplish desired effect |
-Tdata hex |
-M mapfile |
mapfile contains different mechanisms to accomplish desired effect |
-u name |
-u name |
|
-x |
No replacement |
|
-X |
No replacement |
|
-y sym |
No replacement |
|
-z |
Default |