--- bfd/elf.c 2004-09-27 21:46:06.000000000 +0100 +++ bfd/elf.c 2005-05-09 14:28:54.000000000 +0100 @@ -796,7 +796,8 @@ /* Look through the phdrs to see if we need to adjust the lma. If all the p_paddr fields are zero, we ignore them, since some ELF linkers produce such output. */ - phdr = elf_tdata (abfd)->phdr; + if ((phdr = elf_tdata (abfd)->phdr) == NULL) + return FALSE; for (i = 0; i < elf_elfheader (abfd)->e_phnum; i++, phdr++) { if (phdr->p_paddr != 0) @@ -1724,6 +1725,9 @@ const struct elf_backend_data *bed = get_elf_backend_data (abfd); const char *name; + if (hdr == NULL) + return FALSE; + name = elf_string_from_elf_strtab (abfd, hdr->sh_name); switch (hdr->sh_type)