/* SPU specific support for 32-bit ELF
- Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
add = (int) irela->r_addend & 0xffffffff;
if (add != 0)
len += 1 + 8;
- name = bfd_malloc (len);
+ name = bfd_malloc (len + 1);
if (name == NULL)
return FALSE;
{
return count_stub (htab, NULL, NULL, nonovl_stub, h, NULL);
}
-
+
return TRUE;
}
return build_stub (info, NULL, NULL, nonovl_stub, h, NULL,
h->root.u.def.value, sym_sec);
}
-
+
return TRUE;
}
sec_arr = bfd_zmalloc (bfd_idx * sizeof (*sec_arr));
if (sec_arr == NULL)
return FALSE;
-
+
for (ibfd = info->input_bfds, bfd_idx = 0;
ibfd != NULL;
ibfd = ibfd->link_next, bfd_idx++)
if (symtab_hdr->contents != NULL)
{
/* Don't use cached symbols since the generic ELF linker
- code only reads local symbols, and we need globals too. */
+ code only reads local symbols, and we need globals too. */
free (symtab_hdr->contents);
symtab_hdr->contents = NULL;
}
bfd *const *abfd1 = a;
bfd *const *abfd2 = b;
- return strcmp ((*abfd1)->filename, (*abfd2)->filename);
+ return filename_cmp ((*abfd1)->filename, (*abfd2)->filename);
}
static unsigned int
struct bfd_link_info *info)
{
unsigned int j;
-
+
for (j = base; j < count && ovly_map[j] == ovlynum; j++)
{
asection *sec = ovly_sections[2 * j];
qsort (bfd_arr, bfd_count, sizeof (*bfd_arr), sort_bfds);
for (i = 1; i < bfd_count; ++i)
- if (strcmp (bfd_arr[i - 1]->filename, bfd_arr[i]->filename) == 0)
+ if (filename_cmp (bfd_arr[i - 1]->filename, bfd_arr[i]->filename) == 0)
{
if (bfd_arr[i - 1]->my_archive == bfd_arr[i]->my_archive)
{
sym_name = h->root.root.string;
}
- if (sec != NULL && elf_discarded_section (sec))
- {
- /* For relocs against symbols from removed linkonce sections,
- or sections discarded by a linker script, we just want the
- section contents zeroed. Avoid any special processing. */
- _bfd_clear_contents (howto, input_bfd, contents + rel->r_offset);
- rel->r_info = 0;
- rel->r_addend = 0;
- continue;
- }
+ if (sec != NULL && discarded_section (sec))
+ RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section,
+ rel, 1, relend, howto, 0, contents);
if (info->relocatable)
continue;
&& !(h->def_regular || ELF_COMMON_DEF_P (h)))
{
bfd_byte *loc = contents + rel->r_offset;
- loc[0] = 0x1c;
- loc[1] = 0x00;
+ loc[0] = 0x1c;
+ loc[1] = 0x00;
loc[2] &= 0x3f;
}
else if (is_ea_sym)
unresolved_reloc = TRUE;
- if (unresolved_reloc)
+ if (unresolved_reloc
+ && _bfd_elf_section_offset (output_bfd, info, input_section,
+ rel->r_offset) != (bfd_vma) -1)
{
(*_bfd_error_handler)
(_("%B(%s+0x%lx): unresolvable %s relocation against symbol `%s'"),