This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: [Patch]: bugfix add-symbol-file address calculations


Hi,

I submitted this patch 2 weeks ago. There were no replies.

Can the maintainer of elfread.c please tell the status of this patch
( rejected/accepted )?

Thanks.

On Mon, 17 Jan 2000, Amit S. Kale wrote:
> Hi,
> 
> When add-symbol-file command is used with addresses of .text, .data, .bss
> sections specified as arguments, addresses of symbols from sections other than
> .text is wrong.
> 
> This problem is because elf_symtab_read uses the offset for .text segment for
> calculating addresses of symbols in all sections. Following patch fixes this
> problem by using offset for  the section in which a symbol resides.
> 
> Can you please include this patch in gdb?
> Thanks.
> -- 
> Amit Kale
> Veritas Software ( http://www.veritas.com )
> 
> 
> 2000-01-17  Amit S. Kale  <akale@veritas.com>
> 
>         * elfread.c (elf_symtab_read): Use offset for the section in which a
>         symbol resides, instead of .text section for calculating address of a
>         symbol. 
> 
> --- gdb/elfread.c	Mon Jan 17 19:34:01 2000
> +++ gdb/elfread.c	Mon Jan 17 19:32:05 2000
> @@ -293,11 +293,10 @@ elf_symtab_read (objfile, dynamic)
>        if (number_of_symbols < 0)
>  	error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
>  	       bfd_errmsg (bfd_get_error ()));
> -      /* FIXME: Should use section specific offset, not SECT_OFF_TEXT. */
> -      offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
>        for (i = 0; i < number_of_symbols; i++)
>  	{
>  	  sym = symbol_table[i];
> +	  offset = ANOFFSET (objfile->section_offsets, sym->section->index);
>  	  if (sym->name == NULL || *sym->name == '\0')
>  	    {
>  	      /* Skip names that don't exist (shouldn't happen), or names
-- 
Amit Kale
Veritas Software ( http://www.veritas.com )

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