/* V850-specific support for 32-bit ELF
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
struct elf_link_hash_entry **sym_hashes;
const Elf_Internal_Rela *rel;
const Elf_Internal_Rela *rel_end;
- asection *sreloc;
enum v850_reloc_type r_type;
int other = 0;
const char *common = NULL;
dynobj = elf_hash_table (info)->dynobj;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
sym_hashes = elf_sym_hashes (abfd);
- sreloc = NULL;
rel_end = relocs + sec->reloc_count;
for (rel = relocs; rel < rel_end; rel++)
/* This relocation describes which C++ vtable entries
are actually used. Record for later use during GC. */
case R_V850_GNU_VTENTRY:
- if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
+ BFD_ASSERT (h != NULL);
+ if (h != NULL
+ && !bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend))
return FALSE;
break;
name = bfd_section_name (input_bfd, sec);
}
- switch (r)
+ switch ((int) r)
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
return TRUE;
}
-static bfd_boolean
+static int
v850_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
sym->st_other &= ~(V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA
| V850_OTHER_ERROR);
- return TRUE;
+ return 1;
}
static bfd_boolean
Elf32_External_Sym *extsyms;
Elf32_External_Sym *esym;
Elf32_External_Sym *esymend;
- int index;
+ int sym_index;
unsigned int sec_shndx;
bfd_byte *contents;
Elf_Internal_Rela *irel;
esym = extsyms + symtab_hdr->sh_info;
esymend = extsyms + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym));
- for (index = 0; esym < esymend; esym ++, index ++)
+ for (sym_index = 0; esym < esymend; esym ++, sym_index ++)
{
Elf_Internal_Sym isym;
bfd_elf32_swap_symbol_in (abfd, esym, shndx, & isym);
- sym_hash = elf_sym_hashes (abfd) [index];
+ sym_hash = elf_sym_hashes (abfd) [sym_index];
if (isym.st_shndx == sec_shndx
&& ((sym_hash)->root.type == bfd_link_hash_defined