Dynamic symbol table

Karl Vogel karl.vogel at seagha.com
Wed Jul 21 13:16:52 CEST 2004


Lubos Lunak wrote:

> On Tuesday 20 of July 2004 18:37, Karl Vogel wrote:
>>
>> X 08048520        0 X 008 paddr 08048000 acc 08048520 pgoff 00000000 foff
>> 00000000 fnam=/usr/bin/kedit A 002498a3        0 X 002 paddr 00432000 acc
>> 004323f4 pgoff 00000000 foff 00000000 fnam=/usr/lib/libkdeinit_kedit.so A
> 
>  How did you get this? Is it some profiling tool? I don't see anything
>  similar
> in /proc.

I wrote a quick 'n dirty hack to generate this. The tool definately needs to 
TLC, but anyway I'll attach it.

Build it with (Makefile):
---
tracer: tracer.c
        $(CC) -Wall -Os -shared -o tracer tracer.c -ldl
---

Usage is:
  LD_PRELOAD=./tracer executable

Output will go to stderr. The tool assumes it's in /home somewhere, so it 
doesn't mprotect stuff that lives in /home -- ie. as to not block itself :)

Either way.. a valgrind based execution flow tracer would be nicer, but this 
kind of works also. (on Fedora Core 2)

>  Not everything from the file is supposed to be loaded when executing it.
> There may be debug data or similar. If you run 'objdump --headers' on the
> file, find first sections that is not marked LOAD, and its file offset
> column gives in hex how much of the file is actually loaded. (If you just
> strip the file it gives almost the same number.)

Yups.. was aware of this.. otherwise I don't think my KDE would load this 
fast, seeing that my libqt is 63Mb :)

btw: 'readelf -e executable'  also works.. and the output is more readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tracer.c
Type: text/x-csrc
Size: 5283 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-optimize/attachments/20040721/8e6d0ad9/tracer.bin


More information about the Kde-optimize mailing list