This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [PATCH 2/3] libdwfl: Add minisymtab support.
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 22 Jan 2013 17:03:16 +0100
- Subject: Re: [PATCH 2/3] libdwfl: Add minisymtab support.
On Tue, 22 Jan 2013 16:46:48 +0100, Mark Wielaard wrote:
> Yeah, good catch. And although first_global was initialized to -1 that
> was really unnecessary (as you point out below load_symtab now always
> sets it), because we don't use that as marker anymore. I have updated
> the comment and removed that -1 initialization.
- search_table (mod->first_global < 0 ? 1 : mod->first_global, syments);
+ int first_global = mod->first_global + mod->aux_first_global - 1;
+ search_table (first_global < 0 ? 1 : first_global, syments);
Now there is "- 1" with no reason, in fact a bug although not exploitable.
When you decided to keep their initialization at zero then this code should be
for example:
int first_global = (mod->first_global + (mod->aux_first_global
? mod->aux_first_global - 1 : 0));
search_table (mod->first_global > 0 ? 1 : first_global, syments);
Regards,
Jan