This is the mail archive of the mailing list for the elfutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]