B.2. AIX and Linux Linker Options Comparison Table
Table B-2 only lists the most commonly used linker options.
Table B-2. AIX and Linux Linker Switches Comparison Table
AIX
Linux
Description
-bexpall
-E --export-dynamic
When creating a dynamically linked executable, adds all symbols to the dynamic symbol table.
-bmaxdata:<size>
-Gvalue --gpsize=value
Sets the maximum size of objects to be optimized using the GP register to size. This is only meaningful for object file formats such as MIPS ECOFF, which supports putting large and small objects into different sections. This is ignored for other object file formats.
-eLabel
-e entry --entry=entry
Uses entry as the explicit symbol for beginning execution of your program, rather than the default entry point.
-bdynamic or bshared
-Bdynamic -dy -call_shared or -Wl brt -shared
Links against dynamic libraries. The different variants of this option are for compatibility with various systems. You may use this option multiple times on the command line. It affects library searching for -l options that follow it.
-bM:SRE or brtl or G
-shared -Bshareable
Creates a shared library that is reentrant (runtime linkable).
-l
-larchive
Adds the archive file libarchive.a to the list of files to link. This option may be used any number of times. This option also searches for shared objects (.so ) for other platforms; however, when running on a Linux platform, only archives are searched.
-Z
-Y
Specifies a search path for library names.
-L
-rpath path
Specifies the library search direction for the runtime linker.
-L
-L
Searches the specified directory for library files specified by the -l option.