* elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params.
* elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs
params.
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (bfd_elf_final_link): Move code reading relocs to..
+ * elf32-spu.c (spu_elf_count_relocs): ..here. Adjust params.
+ * elf-bfd.h (struct elf_backend_data): Update elf_backend_count_relocs
+ params.
+
2008-10-20 Alan Modra <amodra@bigpond.net.au>
* elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
2008-10-09 Kai Tietz <kai.tietz@onevision.com>
- * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma sized addresses instead of long sized.
+ * cofflink.c (_bfd_coff_generic_relocate_section): Dump bfd_vma
+ sized addresses instead of long sized.
2008-10-09 Alan Modra <amodra@bigpond.net.au>
BFD_MACH_O_x86_EXCEPTION_STATE.
(bfd_mach_o_load_command_type): Add
BFD_MACH_O_LC_SEGMENT_64, BFD_MACH_O_LC_ROUTINES_64,
- BFD_MACH_O_LC_UUID.
+ BFD_MACH_O_LC_UUID.
(BFD_MACH_O_CPU_IS64BIT): Added.
(bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_POWERPC_64,
BFD_MACH_O_CPU_TYPE_X86_64.
(bfd_mach_o_scan_start_address): Ditto.
(bfd_mach_o_scan): Ditto.
(bfd_mach_o_lookup_section): Ditto.
-
+
2008-08-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* elf-hppa.h (elf_hppa_reloc_final_type): Handle R_PARISC_GPREL64,
/* Count relocations. Not called for relocatable links
or if all relocs are being preserved in the output. */
unsigned int (*elf_backend_count_relocs)
- (asection *, Elf_Internal_Rela *);
+ (struct bfd_link_info *, asection *);
/* This function, if defined, is called when an NT_PRSTATUS note is found
in a core file. */
that need to be emitted. */
static unsigned int
-spu_elf_count_relocs (asection *sec, Elf_Internal_Rela *relocs)
+spu_elf_count_relocs (struct bfd_link_info *info, asection *sec)
{
+ Elf_Internal_Rela *relocs;
unsigned int count = 0;
- Elf_Internal_Rela *relend = relocs + sec->reloc_count;
- for (; relocs < relend; relocs++)
+ relocs = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL,
+ info->keep_memory);
+ if (relocs != NULL)
{
- int r_type = ELF32_R_TYPE (relocs->r_info);
- if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64)
- ++count;
+ Elf_Internal_Rela *rel;
+ Elf_Internal_Rela *relend = relocs + sec->reloc_count;
+
+ for (rel = relocs; rel < relend; rel++)
+ {
+ int r_type = ELF32_R_TYPE (rel->r_info);
+ if (r_type == R_SPU_PPU32 || r_type == R_SPU_PPU64)
+ ++count;
+ }
+
+ if (elf_section_data (sec)->relocs != relocs)
+ free (relocs);
}
return count;
if (info->relocatable || info->emitrelocations)
reloc_count = sec->reloc_count;
else if (bed->elf_backend_count_relocs)
- {
- Elf_Internal_Rela * relocs;
-
- relocs = _bfd_elf_link_read_relocs (sec->owner, sec,
- NULL, NULL,
- info->keep_memory);
-
- if (relocs != NULL)
- {
- reloc_count
- = (*bed->elf_backend_count_relocs) (sec, relocs);
-
- if (elf_section_data (sec)->relocs != relocs)
- free (relocs);
- }
- }
+ reloc_count = (*bed->elf_backend_count_relocs) (info, sec);
if (sec->rawsize > max_contents_size)
max_contents_size = sec->rawsize;