{
int dynindx;
bfd_vma addend = rel->r_addend;
+ bfd_vma offset;
+ offset = _bfd_elf_section_offset (output_bfd, info,
+ input_section, rel->r_offset);
/* If the symbol is dynamic but binds locally, use
section+offset. */
}
if (!h || h->root.type != bfd_link_hash_undefweak)
{
- _bfinfdpic_add_rofixup (output_bfd,
- bfinfdpic_gotfixup_section
- (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- input_section, rel->r_offset)
- + input_section
- ->output_section->vma
- + input_section->output_offset,
- picrel);
+ /* Only output a reloc for a not deleted entry. */
+ if (offset >= (bfd_vma)-2)
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section
+ (info), -1, picrel);
+ else
+ _bfinfdpic_add_rofixup (output_bfd,
+ bfinfdpic_gotfixup_section
+ (info),
+ offset + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ picrel);
+
if (r_type == R_BFIN_FUNCDESC_VALUE)
- _bfinfdpic_add_rofixup
- (output_bfd,
- bfinfdpic_gotfixup_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- input_section, rel->r_offset)
- + input_section->output_section->vma
- + input_section->output_offset + 4, picrel);
+ {
+ if (offset >= (bfd_vma)-2)
+ _bfinfdpic_add_rofixup
+ (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ -1, picrel);
+ else
+ _bfinfdpic_add_rofixup
+ (output_bfd,
+ bfinfdpic_gotfixup_section (info),
+ offset + input_section->output_section->vma
+ + input_section->output_offset + 4, picrel);
+ }
}
}
}
name, input_bfd, input_section, rel->r_offset);
return FALSE;
}
- _bfinfdpic_add_dyn_reloc (output_bfd,
- bfinfdpic_gotrel_section (info),
- _bfd_elf_section_offset
- (output_bfd, info,
- input_section, rel->r_offset)
- + input_section
- ->output_section->vma
- + input_section->output_offset,
- r_type, dynindx, addend, picrel);
+ /* Only output a reloc for a not deleted entry. */
+ if (offset >= (bfd_vma)-2)
+ _bfinfdpic_add_dyn_reloc (output_bfd,
+ bfinfdpic_gotrel_section (info),
+ 0, R_unused0, dynindx, addend, picrel);
+ else
+ _bfinfdpic_add_dyn_reloc (output_bfd,
+ bfinfdpic_gotrel_section (info),
+ offset
+ + input_section
+ ->output_section->vma
+ + input_section->output_offset,
+ r_type, dynindx, addend, picrel);
}
else if (osec)
addend += osec->output_section->vma;
relocation = addend - rel->r_addend;
}
- if (r_type == R_BFIN_FUNCDESC_VALUE)
+ if (r_type == R_BFIN_FUNCDESC_VALUE && offset < (bfd_vma)-2)
{
/* If we've omitted the dynamic relocation, just emit
the fixed addresses of the symbol and of the local