Next | Prev | Up | Top | Contents | Index

Building and Running the N32 Application

The commands for building an n32 version of app1 are shown below. The only difference is in the use of the -n32 argument on the compiler command line. If app1 was a large application using many libraries, the command line or makefile would possibly need to be modified to refer to the correct library paths. In the case of app1 the correct libc.so is automatically used as a result of the -n32 argument.

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

%cc -n32 -O -o app1 main.c foo.c gp.s regs.so

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

%setenv LD_LIBRARY_PATH .

Running the application produces the following results. Note that the values of some of the returned registers are different from those returned by the o32 version of app1.

%app1

gp is 0x100090e8

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 0x10000d68

sp is 0x7fff2e30

result of double precision add is 3.000000e+00



Next | Prev | Up | Top | Contents | Index