+2009-02-09 Alan Modra <amodra@bigpond.net.au>
+
+ * elf32-spu.c (spu_elf_find_overlays): Call bfd_set_error on errors.
+ (find_function): Likewise.
+ (pasted_function): Don't error if no prior function found.
+ (discover_functions): Revert 2008-12-10 change. Extend first
+ function range to start of section.
+
2009-02-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* elf64-hppa.c: Remove PARAMS macro. Replace PTR with void *. Convert
info->callbacks->einfo (_("%X%P: overlay section %A "
"does not start on a cache line.\n"),
s);
+ bfd_set_error (bfd_error_bad_value);
return FALSE;
}
else if (s->size > htab->params->line_size)
info->callbacks->einfo (_("%X%P: overlay section %A "
"is larger than a cache line.\n"),
s);
+ bfd_set_error (bfd_error_bad_value);
return FALSE;
}
info->callbacks->einfo (_("%X%P: overlay section %A "
"is not in cache area.\n"),
alloc_sec[i-1]);
+ bfd_set_error (bfd_error_bad_value);
return FALSE;
}
else
"and %A do not start at the "
"same address.\n"),
s0, s);
+ bfd_set_error (bfd_error_bad_value);
return FALSE;
}
if (ovl_end < s->vma + s->size)
}
info->callbacks->einfo (_("%A:0x%v not found in function table\n"),
sec, offset);
+ bfd_set_error (bfd_error_bad_value);
return NULL;
}
These sections are pasted together to form a single function. */
static bfd_boolean
-pasted_function (asection *sec, struct bfd_link_info *info)
+pasted_function (asection *sec)
{
struct bfd_link_order *l;
struct _spu_elf_section_data *sec_data;
fun_start = &sinfo->fun[sinfo->num_fun - 1];
}
- info->callbacks->einfo (_("%A link_order not found\n"), sec);
- return FALSE;
+ /* Don't return an error if we did not find a function preceding this
+ section. The section may have incorrect flags. */
+ return TRUE;
}
/* Map address ranges in code sections to functions. */
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;
sec_arr[bfd_idx] = psecs;
for (psy = psyms, p = psecs, sy = syms; sy < syms + symcount; ++p, ++sy)
if (ELF_ST_TYPE (sy->st_info) == STT_NOTYPE
- || ELF_ST_TYPE (sy->st_info) == STT_FUNC
- || ELF_ST_TYPE (sy->st_info) == STT_SECTION)
+ || ELF_ST_TYPE (sy->st_info) == STT_FUNC)
{
asection *s;
sec_data = spu_elf_section_data (sec);
sinfo = sec_data->u.i.stack_info;
- if (sinfo != NULL)
+ if (sinfo != NULL && sinfo->num_fun != 0)
{
int fun_idx;
bfd_vma hi = sec->size;
sinfo->fun[fun_idx].hi = hi;
hi = sinfo->fun[fun_idx].lo;
}
+
+ sinfo->fun[0].lo = 0;
}
/* No symbols in this section. Must be .init or .fini
or something similar. */
- else if (!pasted_function (sec, info))
+ else if (!pasted_function (sec))
return FALSE;
}
}