In order to run the application, the LD_LIBRARY_PATH environment variable must be set to the directory where regs.so resides.%cc -32 -O -shared -o regs.so regs.s
%cc -32 -O -o app1 main.c foo.c gp2.s regs.so
Running the application produces the following results. Note that the value of $gp is different when code is executing in the regs.so DSO.%setenv LD_LIBRARY_PATH .
%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