Next | Prev | Up | Top | Contents | Index

Building and Running the o32 Application

The commands used to build app1 are shown below. As mentioned previously, regs.s is compiled and linked separately into its own DSO, while main.c, foo.c and gp.s are compiled and linked together.

%cc -32 -O -shared -o regs.so regs.s

%cc -32 -O -o app1 main.c foo.c gp2.s regs.so

In order to run the application, the LD_LIBRARY_PATH environment variable must be set to the directory where regs.so resides.

%setenv LD_LIBRARY_PATH .

Running the application produces the following results. Note that the value of $gp is different when code is executing in the regs.so DSO.

%app1

gp is 0x100090f0

Number of Arguments is: 7

3.140000e+00

first double precision argument is 1.000000e+00

second double precision argument is 2.000000e+00

Back from assembly routine

gp is 0x5fff8ff0

ra is 0x400d10

sp is 0x7fff2e28

result of double precision add is 3.000000e+00



Next | Prev | Up | Top | Contents | Index