On Tue, 22 Jan 2013 16:46:48 +0100, Mark Wielaard wrote:
Yeah, good catch. And although first_global was initialized to -1
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
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);