This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Improve objdump -S performance
On Mon, Apr 27, 2009 at 08:22:26AM +0200, Andi Kleen wrote:
> > I think this will return incorrect results. Given a file with more
> > than one function in a section, won't you stay stuck returning the
> > lowest function symbol when disassembling the section?
>
> The if (c->symbol.value >= cached_low_func && c->symbol.value <= offset)
> test takes care of that.
How? Given f1 and f2 symbols in a section, f2 > f1, start
disassembling at f1, offset of 0. This loads up cached_low_func with
zero and cached symbol of f1. As offset increases during disassembly
of f1, things are fine until you start disassembling f2. What throws
f1 out of the cache? The test you show above still passes. In fact,
the c->symbol.value >= cached_low_func is totally useless since it is
just comparing parts of your cache!
> I'm also careful to invalidate when the symbol could be reused.
>
> I verified it by disassembling all the files in a Linux build
> both with old and new objdump and it gives the same output.
Was -ffunction-sections in effect?
--
Alan Modra
Australia Development Lab, IBM