This is the mail archive of the elfutils-devel@sourceware.org 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, 16 Jan 2013 15:54:13 +0100, Mark Wielaard wrote:
> +  /* All local symbols should come before all global symbols.  If we
> +     have an auxiliary table make sure all the main locals come first
> +     and all main globals come last.  And skip the auxiliary table
> +     zero undefined entry.  */
>    GElf_Word shndx;
> -  sym = gelf_getsymshndx (mod->symdata, mod->symxndxdata, ndx, sym, &shndx);
> +  int tndx = ndx;
> +  struct dwfl_file *file;
> +  Elf_Data *symdata;
> +  Elf_Data *symxndxdata;
> +  Elf_Data *symstrdata;
> +  if (mod->aux_symdata == NULL
> +      || ndx < mod->first_global)
> +    {
> +      /* main symbol table (locals).  */
> +      tndx = ndx;
> +      file = mod->symfile;
> +      symdata = mod->symdata;
> +      symxndxdata = mod->symxndxdata;
> +      symstrdata = mod->symstrdata;
> +    }
> +  else if ((size_t) ndx < mod->first_global + mod->aux_syments)
> +    {
> +      /* aux symbol table.  */
> +      tndx = ndx - mod->first_global + 1;
> +      file = &mod->aux_sym;
> +      symdata = mod->aux_symdata;
> +      symxndxdata = mod->aux_symxndxdata;
> +      symstrdata = mod->aux_symstrdata;
> +    }
> +  else
> +    {
> +      /* main symbol table (globals).  */
> +      tndx = ndx - mod->aux_syments;
> +      file = mod->symfile;
> +      symdata = mod->symdata;
> +      symxndxdata = mod->symxndxdata;
> +      symstrdata = mod->symstrdata;
> +    }

As elfutils is already careful with choosing symbols order in
dwfl_module_addrsym.c couldn't the aux-symtab local symbols have the same
preference to the main local symbols like the global symbols have?

I do not find breaking the symbols order is worth the small simplification of
the code.



Thanks,
Jan

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