Generate an error message if a section cannot be found for a symbol.

This commit is contained in:
Nick Clifton 2003-02-07 14:27:59 +00:00
parent d460ab5823
commit 589e6347e9
2 changed files with 19 additions and 3 deletions

View file

@ -1,8 +1,14 @@
2003-02-07 Nick Clifton <nickc@redhat.com>
* elf.c (swap_out_syms): Generate an error message if an
equivalent output section cannot be found for a symbol.
2003-02-07 Jakub Jelinek <jakub@redhat.com> 2003-02-07 Jakub Jelinek <jakub@redhat.com>
* elf64-alpha.c (elf64_alpha_relax_section): Don't crash if * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if
local_got_entries is NULL. local_got_entries is NULL.
2003-02-06 Andreas Schwab <schwab@suse.de> 2003-02-06 Andreas Schwab <schwab@suse.de>
* elf-eh-frame.c (get_DW_EH_PE_signed): Define. * elf-eh-frame.c (get_DW_EH_PE_signed): Define.

View file

@ -5309,7 +5309,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx);
} }
/* now generate the data (for "contents") */ /* Now generate the data (for "contents"). */
{ {
/* Fill in zeroth symbol and swap it out. */ /* Fill in zeroth symbol and swap it out. */
Elf_Internal_Sym sym; Elf_Internal_Sym sym;
@ -5375,6 +5375,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
value += sec->output_offset; value += sec->output_offset;
sec = sec->output_section; sec = sec->output_section;
} }
/* Don't add in the section vma for relocatable output. */ /* Don't add in the section vma for relocatable output. */
if (! relocatable_p) if (! relocatable_p)
value += sec->vma; value += sec->vma;
@ -5426,7 +5427,16 @@ swap_out_syms (abfd, sttp, relocatable_p)
section of a symbol to be a section that is section of a symbol to be a section that is
actually in the output file. */ actually in the output file. */
sec2 = bfd_get_section_by_name (abfd, sec->name); sec2 = bfd_get_section_by_name (abfd, sec->name);
BFD_ASSERT (sec2 != 0); if (sec2 == NULL)
{
_bfd_error_handler (_("\
Unable to find equivalent output section for symbol '%s' from section '%s'"),
syms[idx]->name ? syms[idx]->name : "<Local sym>",
sec->name);
bfd_set_error (bfd_error_invalid_operation);
return FALSE;
}
shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); shndx = _bfd_elf_section_from_bfd_section (abfd, sec2);
BFD_ASSERT (shndx != -1); BFD_ASSERT (shndx != -1);
} }
@ -5447,7 +5457,7 @@ swap_out_syms (abfd, sttp, relocatable_p)
if (syms[idx]->section->flags & SEC_THREAD_LOCAL) if (syms[idx]->section->flags & SEC_THREAD_LOCAL)
type = STT_TLS; type = STT_TLS;
/* Processor-specific types */ /* Processor-specific types. */
if (type_ptr != NULL if (type_ptr != NULL
&& bed->elf_backend_get_symbol_type) && bed->elf_backend_get_symbol_type)
type = ((*bed->elf_backend_get_symbol_type) type = ((*bed->elf_backend_get_symbol_type)