|| h->root.type == bfd_link_hash_defweak)
&& ! bfd_is_abs_section (h->root.u.def.section)
&& bfd_is_abs_section (h->root.u.def.section
- ->output_section))
+ ->output_section)
+ && elf_section_data (h->root.u.def.section)->merge_info
+ == NULL)
{
#if BFD_VERSION_DATE < 20031005
if ((o->flags & SEC_DEBUGGING) != 0)
_("warning: relocation against removed section; zeroing"),
NULL, input_bfd, o, rel->r_offset);
#endif
+ BFD_ASSERT (r_symndx != 0);
memset (rel, 0, sizeof (*rel));
}
else
if (sec != NULL
&& ! bfd_is_abs_section (sec)
- && bfd_is_abs_section (sec->output_section))
+ && bfd_is_abs_section (sec->output_section)
+ && elf_section_data (sec)->merge_info == NULL)
{
#if BFD_VERSION_DATE < 20031005
if ((o->flags & SEC_DEBUGGING) != 0
_("warning: relocation against removed section"),
NULL, input_bfd, o, rel->r_offset);
#endif
+ BFD_ASSERT (r_symndx != 0);
rel->r_info
= ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
rel->r_addend = 0;
else if (rcookie->locsyms)
{
/* It's not a relocation against a global symbol,
- but it could be a relocation against a section
+ but it could be a relocation against a local
symbol for a discarded section. */
asection *isec;
{
isec = section_from_elf_index (rcookie->abfd, isym.st_shndx);
if (isec != NULL
- && ELF_ST_TYPE (isym.st_info) == STT_SECTION
&& ! bfd_is_abs_section (isec)
&& bfd_is_abs_section (isec->output_section))
return true;