LEEL 1.0 Release Notes

1.	Installation & Compilation

After copy the file to your LEEL home directory, modify common_def
file to set your LEEL_DIR directory, e.g.

LEEL_DIR=/home/fl/leel

After this, simply run make to generate the LEEL library: libeel.a,
which will be located in the lib sub-directrory.

To compile examples, cd to src/examples and run make.

The recommended compiler is egcs 2.9 or above.  Older version of gcc
does not support automatic template instantiation, which results in
larger executable files.


2.  Examples

In the src/examples directory, there are five sub-directories:

*	test

This directory contains a simple C program "d", which makes use of
a shared library: libd1.so.  Test can be done to d, libd1.so or
their object files.

*	test_so

This directory contains the sample shared library used for the three
LEEL sample programs.  To use it, make sure that the LD_LIBRARY_PATH
is set correctly.

*	LEEL sample programs

There are three LEEL sample programs: elfinfo, trace and redirect.

2.1.	elfinfo

To test elfinfo, use the following command:

elfinfo <target_elf_file>

elfinfo will output some information regarding the ELF program.
For example, first cd to src/examples/test directory, then try the
following:

../elfinfo/elfinfo d
../elfinfo/elfinfo d.o
../elfinfo/elfinfo libd1.so.1.0


2.2	trace

The program "trace" will trace all named routines in the target file
so that every routine will call function "enter" when enters into
the routine and call "exit" when exits from the routine.  The command
is:

trace <old_executable> <new_executable>

To test it, the simplest way is:

setenv LD_LIBRARY_PATH=.
cd src/examples/test

# test executable
../trace/trace/d d1
chmod u+x d1
./d1
cat trace.log

# test shared library
mv libd1.so.1.0 libd2.so
../trace/trace/libd2.so libd1.so.1.0
./d
cat trace.log
mv libd2.so libd1.so.1.0

# test object file
mv d.o dd.o
../trace/tarce dd.o d.o
gcc d.o -o d -L. -ld1 -ltest
./d
cat trace.log
mv dd.o d.o
gcc d.o -o d -L. -ld1


2.3	redirect

The program redirect will redirect a routine to a user-defined one
in a shared library.  The command is:

redirect <old_executable> <new_executable> <source_routine>
		<target_routine> [shared_library]

To test it:

setenv LD_LIBRARY_PATH=.
cd src/examples/test

# test executable
../redirect/redirect d d1 func2 enter libtest.so.1
chmod u+x d1
./d1
cat trace.log

# test shared library
mv libd1.so.1.0 libd2.so
../redirect/redirect libd2.so libd1.so.1.0 strlen enter libtest.so.1
./d
cat trace.log
mv libd2.so libd1.so.1.0

# test object file
mv d.o dd.o
../redirect/redirect dd.o d.o func2 enter
gcc d.o -o d -L. -ld1 -ltest
./d
cat trace.log
mv dd.o d.o
gcc d.o -o d -L. -ld1

