Figure 27 Example 3: Hidden Definitions: Modifying a Function

Compile the new f3(), and rebuild the shared library lib3.so including the new dependency on f2() in lib12.so:

$ cc -c +z f3.c

Compile to PIC.

$ ld -b -o lib3.so f3.o -L . -l12

Create library with dependency.

Figure 28 Example 3: Hidden Definitions: Rebuilding the Shared Library

Problem Here is where the problem can occur in PA-32 +compat modes. If you do not relink the application, main.o, and just run a.out with the new version of lib3.so, the program executes successfully, but it executes two different versions of f2(). main() calls f2() in the program file a.out and f3() calls f2() in lib12.so. Even though f2() is contained within the application, it is not visible to the shared library, lib3.so.

Figure 29 Example 3: Hidden Definitions: Problem of Unsatisfied Symbol

Using Shared Libraries in Default Mode

HP provides an industry-standard linker toolset for programs linked in IPF mode. The new toolset consists of a linker, dynamic loader, object file class library, and an object file tool collection. Although compatibility between the current and previous toolset is an important goal, some

124 Creating and Using Libraries