This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: RFA: Stop objdump crash on corrupt reloc table


On Tue, Sep 17, 2002 at 12:39:03PM -0400, Daniel Jacobowitz wrote:
> 2002-09-17  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* elfcode.h (elf_slurp_reloc_table_from_section): Add nsyms
> 	argument.  Check for overflow.
> 	(elf_slurp_reloc_table): Count symbols and pass nsyms to
> 	elf_slurp_reloc_table_from_section.

Looks OK, except..

> @@ -1510,17 +1519,22 @@ elf_slurp_reloc_table (abfd, asect, symb
>    if (relents == NULL)
>      return false;
>  
> +  /* ``symbols'' is NULL-terminated.  */
> +  nsyms = 0;
> +  while (symbols[nsyms] != NULL)
> +    nsyms++;

bfd_get_symcount (abfd) ?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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