aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-09-24 01:38:31 +0000
committerAlan Modra <amodra@gmail.com>2001-09-24 01:38:31 +0000
commitf51e552e0e058cee7ac698cbd8aaac033607dd86 (patch)
tree2690c4f299f4b78fd68bcbdb6f06114b798850bc /bfd/elflink.h
parent02ca6eb41d9c75a33dc28d826353646e919a298f (diff)
downloadfsf-binutils-gdb-f51e552e0e058cee7ac698cbd8aaac033607dd86.zip
fsf-binutils-gdb-f51e552e0e058cee7ac698cbd8aaac033607dd86.tar.gz
fsf-binutils-gdb-f51e552e0e058cee7ac698cbd8aaac033607dd86.tar.bz2
* elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
reloc rather than just the type. (_bfd_elf_reloc_type_class): Likewise. * elf.c (_bfd_elf_reloc_type_class): Likewise. * elf32-arm.h (elf32_arm_reloc_type_class): Likewise. * elf32-cris.c (elf_cris_reloc_type_class): Likewise. * elf32-i386.c (elf_i386_reloc_type_class): Likewise. * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise. * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise. * elf32-s390.c (elf_s390_reloc_type_class): Likewise. * elf32-sh.c (sh_elf_reloc_type_class): Likewise. * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise. * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise. * elf64-s390.c (elf_s390_reloc_type_class): Likewise. * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise. * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise. * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise. * elflink.h: Formatting fixes. (elf_link_sort_relocs): Make "count" and "size" bfd_size_type. Call bfd_zmalloc rather than calloc. Remove unnecessary cast of o->contents to PTR. Update call to elf_backend_reloc_type_class.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 393f932..e38f0d5 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -4338,8 +4338,8 @@ elf_link_sort_cmp1 (A, B)
const PTR A;
const PTR B;
{
- struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A;
- struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B;
+ struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A;
+ struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B;
int relativea, relativeb;
relativea = a->type == reloc_class_relative;
@@ -4365,8 +4365,8 @@ elf_link_sort_cmp2 (A, B)
const PTR A;
const PTR B;
{
- struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A;
- struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B;
+ struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A;
+ struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B;
int copya, copyb;
if (a->offset < b->offset)
@@ -4395,7 +4395,8 @@ elf_link_sort_relocs (abfd, info, psec)
bfd *dynobj = elf_hash_table (info)->dynobj;
asection *reldyn, *o;
boolean rel = false;
- size_t count, size, i, j, ret;
+ bfd_size_type count, size;
+ size_t i, j, ret;
struct elf_link_sort_rela *rela;
struct elf_backend_data *bed = get_elf_backend_data (abfd);
@@ -4421,7 +4422,7 @@ elf_link_sort_relocs (abfd, info, psec)
if (size != reldyn->_raw_size)
return 0;
- rela = (struct elf_link_sort_rela *) calloc (sizeof (*rela), count);
+ rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count);
if (rela == NULL)
{
(*info->callbacks->warning)
@@ -4441,7 +4442,7 @@ elf_link_sort_relocs (abfd, info, psec)
struct elf_link_sort_rela *s;
erel = (Elf_External_Rel *) o->contents;
- erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size);
+ erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
s = rela + o->output_offset / sizeof (Elf_External_Rel);
for (; erel < erelend; erel++, s++)
{
@@ -4450,8 +4451,7 @@ elf_link_sort_relocs (abfd, info, psec)
else
elf_swap_reloc_in (abfd, erel, &s->u.rel);
- s->type = ((*bed->elf_backend_reloc_type_class)
- ((int) ELF_R_TYPE (s->u.rel.r_info)));
+ s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
}
}
else
@@ -4460,7 +4460,7 @@ elf_link_sort_relocs (abfd, info, psec)
struct elf_link_sort_rela *s;
erela = (Elf_External_Rela *) o->contents;
- erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size);
+ erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
s = rela + o->output_offset / sizeof (Elf_External_Rela);
for (; erela < erelaend; erela++, s++)
{
@@ -4470,8 +4470,7 @@ elf_link_sort_relocs (abfd, info, psec)
else
elf_swap_reloca_in (dynobj, erela, &s->u.rela);
- s->type = ((*bed->elf_backend_reloc_type_class)
- ((int) ELF_R_TYPE (s->u.rel.r_info)));
+ s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
}
}
}