Function Check 1.4 with updates from
hyc@highlandsun.com
The name-extraction code is much faster and more
memory-efficient.
This was my primary motivation behind this patch,
aside from also
fixing some crashes in the original 1.4 code.
Also I had some problems because I'm still using glibc
2.0.x and
its malloc library doesn't provide the caller's
address in its
hook handler functions, so there's a small patch for
my purposes
included here. (See lib/fncmalloc.c)
Additionally, I added a list of the dynamically loaded
objects and
their base memory addresses to the end of the
fnccheck.out dump file.
This was needed to do correct name resolution for
dynamically linked
objects. This patch allows all dynamic symbols to be
fully resolved.
(See lib/fnccheck.c)
The majority of the changes are in the dump program.
The program
now looks for the dynamic object list and uses it if
present. I
have removed the ldd-based code. I have also
reorganized the
name-related data structures to streamline the naming
operations.
This code is 50-100 times faster now (as gauged by
gprof). Some
cosmetic changes were needed in fncdump.c to
accomodate the
reorganization. The most noticable impact is that I
split the
"file:line" string into just a "file" string and an
integer line
number. So, all of the printf statements needed to
have the "line"
argument added. Doing this allows the memory footprint
to be
drastically reduced, since only one copy of any file
string needs
to be kept in memory. Also, I've used binary searches
in the name
lookup code to speed things up there, along with many
other
optimizations.
-- Howard Chu, hyc@highlandsun.com, 2001-09-24
Unified diff from 1.4 base