This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Objdump crash on prelinked ARM binaries
On Thu, Jun 05, 2003 at 11:36:29AM -0400, Daniel Jacobowitz wrote:
> On Thu, Jun 05, 2003 at 09:47:09AM -0400, Daniel Jacobowitz wrote:
> > arm-linux targets only provide elf_info_to_howto_rel. Then, when objdump
> > finds Rela relocations in a prelinked object file, it dereferences a NULL
> > pointer trying to call ebd->elf_info_to_howto. Will it break anything to
> > always provide both elf_info_to_howto functions?
>
> It doesn't appear to break anything. Is this OK?
I've checked in this version instead, approved by Nick off-list.
Thanks, Nick.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-06-05 Daniel Jacobowitz <drow@mvista.com>
* elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference
NULL function pointers.
Index: elfcode.h
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/bfd/elfcode.h,v
retrieving revision 1.42
diff -u -p -r1.42 elfcode.h
--- elfcode.h 21 May 2003 00:56:05 -0000 1.42
+++ elfcode.h 5 Jun 2003 16:20:17 -0000
@@ -1363,7 +1363,9 @@ elf_slurp_reloc_table_from_section (abfd
relent->addend = rela.r_addend;
- if (entsize == sizeof (Elf_External_Rela))
+ if ((entsize == sizeof (Elf_External_Rela)
+ && ebd->elf_info_to_howto != NULL)
+ || ebd->elf_info_to_howto_rel == NULL)
(*ebd->elf_info_to_howto) (abfd, relent, &rela);
else
(*ebd->elf_info_to_howto_rel) (abfd, relent, &rela);