* elflink.h (elf_link_input_bfd): Complain about all relocs

against local syms from discarded sections.
	(elf_reloc_symbol_deleted_p): Don't try to swap in external syms.
This commit is contained in:
Alan Modra
2001-11-15 09:31:25 +00:00
parent 33861b119a
commit f9f32305f7
2 changed files with 49 additions and 48 deletions

View File

@ -1,3 +1,10 @@
2001-11-15 Alan Modra <amodra@bigpond.net.au>
* elflink.h (elf_link_input_bfd): Complain about all relocs
against local syms from discarded sections. K&R fixes.
(elf_reloc_symbol_deleted_p): Don't try to swap in external syms.
K&R fixes.
2001-11-15 Alexandre Oliva <aoliva@redhat.com> 2001-11-15 Alexandre Oliva <aoliva@redhat.com>
* elf64-sparc.c (sparc64_elf_relocate_section): Disregard * elf64-sparc.c (sparc64_elf_relocate_section): Disregard

View File

@ -6342,9 +6342,6 @@ elf_link_input_bfd (finfo, input_bfd)
} }
} }
else else
{
isym = finfo->internal_syms + r_symndx;
if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
{ {
asection *sec = finfo->sections[r_symndx]; asection *sec = finfo->sections[r_symndx];
@ -6394,7 +6391,6 @@ elf_link_input_bfd (finfo, input_bfd)
} }
} }
} }
}
/* Relocate the section by invoking a back end routine. /* Relocate the section by invoking a back end routine.
@ -6595,7 +6591,7 @@ elf_link_input_bfd (finfo, input_bfd)
/* Write out the modified section contents. */ /* Write out the modified section contents. */
if (bed->elf_backend_write_section if (bed->elf_backend_write_section
&& bed->elf_backend_write_section (output_bfd, o, contents)) && (*bed->elf_backend_write_section) (output_bfd, o, contents))
{ {
/* Section written out. */ /* Section written out. */
} }
@ -7786,9 +7782,9 @@ elf_reloc_symbol_deleted_p (offset, cookie)
if (rcookie->rel->r_offset != offset) if (rcookie->rel->r_offset != offset)
continue; continue;
if (rcookie->locsyms) if (rcookie->locsyms && r_symndx < rcookie->locsymcount)
elf_swap_symbol_in (rcookie->abfd, elf_swap_symbol_in (rcookie->abfd,
((Elf_External_Sym *)rcookie->locsyms) + r_symndx, (Elf_External_Sym *) rcookie->locsyms + r_symndx,
&isym); &isym);
if (r_symndx >= rcookie->locsymcount if (r_symndx >= rcookie->locsymcount
@ -7953,11 +7949,9 @@ elf_section_ignore_discarded_relocs (sec)
return true; return true;
else if ((get_elf_backend_data (sec->owner) else if ((get_elf_backend_data (sec->owner)
->elf_backend_ignore_discarded_relocs != NULL) ->elf_backend_ignore_discarded_relocs != NULL)
&& (get_elf_backend_data (sec->owner) && (*get_elf_backend_data (sec->owner)
->elf_backend_ignore_discarded_relocs (sec))) ->elf_backend_ignore_discarded_relocs) (sec))
return true; return true;
else else
return false; return false;
} }