The sample in this directory provides the following
output:
%./ldt testmain
L ET_EXEC: @0x08048000: testmain
L ET_DYN: @0x28101000: ./first
L ET_DYN: @0x28103000: ./second
D ET_DYN: @0x28103000: ./second
D ET_DYN: @0x28101000: ./first
process 21723 exited, exit code=0
The above should be self explanatory. The load trace
program exec'd testmain which then dynamically loaded
the first and second shared images.
Comments about possible improvements are always
welcome.
Heavy reading of
ptrace(2)
,
elf(5)
and
i386_set_watch(3)/i386_clr_watch(3)
is recommended.
A tarfile with all the pieces is here.
The parts of ldt are
ldt.c
,
ptrace.c
and
elfutil.c
.