Figure 4 Symbols Inside a Shared Library Visible with
Case 2: Building a Shared Library with
The
For example, you can hide the gal_to_liter symbol, as shown:
$ ld
or export the convert_rtn symbol:
$ ld
In both cases, main2 cannot to resolve its reference to gal_to_liter() because only the convert_rtn() symbol is exported, as shown below in Figure 5 (page 35).
Figure 5 Symbol Hidden in a Shared Library
Using Linker Commands 35