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: Wed, 23 Jan 2013 19:04:09 +0100
- Subject: Re: [PATCH 2/3] libdwfl: Add minisymtab support.
On Wed, 23 Jan 2013 17:48:24 +0100, Mark Wielaard wrote:
> @@ -1077,6 +1085,10 @@ find_symtab (Dwfl_Module *mod)
> mod->aux_symdata = elf_getdata (aux_symscn, NULL);
> if (mod->aux_symdata == NULL)
> goto aux_cleanup;
> +
> + /* We will skip the auxiliary zero entry if there is another one. */
> + if (mod->syments > 0 && mod->aux_syments > 0)
> + mod->aux_syments--;
I have not tried to find a reproducer, if there is any.
But I find it messy a bit, You adjust AUX_SYMENTS for that initial zero
symbol but you do not adjust AUX_FIRST_GLOBAL for that initial zero symbol.
Therefore AUX_SYMENTS and AUX_FIRST_GLOBAL numbering is off-by-one.
I would prefer to not modify the member variable AUX_SYMENTS and only adjust
it if needed / when read, as you already do with AUX_FIRST_GLOBAL.
TBH FYI / no request here: I no not find this first_global + syments too clear
now when combining multiple symbol tables, which is why I have refactored it in:
[patch 1/3] ppc64 .opd: Refactor syments/first_global
https://lists.fedorahosted.org/pipermail/elfutils-devel/2012-December/002839.html
Regards,
Jan