-Wl,option
Pass option as an option to the linker. If option contains commas, it is
split into multiple options at the commas. You can use this syntax to pass
an argument to the option. For example, -Wl,-Map,output.map passes -Map output.map
to the linker. When using the GNU linker, you can also get the same effect with
-Wl,-Map=output.map.
下面是man ld分别对-Bstatic和-Bdynamic的描述,
12345678910111213141516
-Bdynamic
-dy
-call_shared
Link against dynamic libraries. You may use this option multiple times on the
command line: it affects library searching for -l options which follow it.
-Bstatic
-dn
-non_shared
-static
Do not link against shared libraries. You may use this option multiple times on
the command line: it affects library searching for -l options which follow it.
This option also implies --unresolved-symbols=report-all. This option can be
used with -shared. Doing so means that a shared library is being created but
that all of the library's external references must be resolved by pulling in
entries from static libraries.