4.3. Testing

Before taking the big plunge (rebooting) we can run a few tests to make sure things are working reasonably well. Remember that hello program that we cross-compiled? We can ftp put that to the new system and make sure it runs:

# cd /mnt/root/bin
# chmod +x hello
# ./hello
./hello: error while loading shared libraries: libgcc_s.so.1: cannot load shared object file: No such file or directory
       

Whoops! The dynamic loader doesn't know where to find our libraries. We can help it out:

# export LD_LIBRARY_PATH=/mnt/root/lib
# ./hello
./hello: /lib/ld.so.1: version `GLIBC_PRIVATE' not found (required by /mnt/root/lib/libc.so.6)
       

Damn! Still doesn't work. That's because by default we're using the old dynamic loader. To use the new loader:

# /mnt/root/lib/ld.so.1 ./hello
Hello, world!
       

Cool.

# /mnt/root/lib/ld.so.1 --list ./hello
        libgcc_s.so.1 => /mnt/root/lib/libgcc_s.so.1 (0x0ffd3000)
        libc.so.6 => /mnt/root/lib/libc.so.6 (0x0fe70000)
        /lib/ld.so.1 => /mnt/root/lib/ld.so.1 (0x08000000)
       

# ls -l
ls: /lib/ld.so.1: version `GLIBC_PRIVATE' not found (required by /mnt/root/lib/libc.so.6)
# ifconfig
ifconfig: /lib/ld.so.1: version `GLIBC_PRIVATE' not found (required by /mnt/root/lib/libc.so.6)
# vi
vi: /lib/ld.so.1: version `GLIBC_PRIVATE' not found (required by /mnt/root/lib/libc.so.6)
       

Oh no! Nothing works anymore!!

Oh yea...

# unset LD_LIBRARY_PATH
       
:-)

So we're now sure that what we cross-compiled will actually work on this architecture. We're also sure that the dynamic loader and shared libraries work. We have a good deal of confidence that this new image will work well. But there's only one way to really know...