& ELF_LINK_HASH_DEF_REGULAR) == 0))))
{
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
boolean skip, relocate;
/* When generating a shared object, these relocations
}
}
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
/* If this reloc is against an external symbol, we do
not want to fiddle with the addend. Otherwise, we
if (info->shared)
{
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
if (srelgot == NULL)
{
+ off);
outrel.r_info = ELF32_R_INFO (0, R_SH_RELATIVE);
outrel.r_addend = relocation;
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- srelgot->contents)
- + srelgot->reloc_count));
- ++srelgot->reloc_count;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
}
#ifdef INCLUDE_SHMEDIA
unsigned short insn;
int indx;
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
{
outrel.r_addend = relocation - dtpoff_base (info);
else
outrel.r_addend = 0;
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue;
}
else
{
Elf_Internal_Rela outrel;
- Elf32_External_Rela *loc;
+ bfd_byte *loc;
int dr_type, indx;
if (srelgot == NULL)
else
outrel.r_addend = 0;
outrel.r_info = ELF32_R_INFO (indx, dr_type);
- loc = (Elf32_External_Rela *) srelgot->contents;
- loc += srelgot->reloc_count++;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
if (r_type == R_SH_TLS_GD_32)
outrel.r_offset += 4;
outrel.r_addend = 0;
srelgot->reloc_count++;
- loc++;
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- loc);
+ loc += sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
}
}
else
{
Elf_Internal_Rela outrel;
- Elf32_External_Rela *loc;
+ bfd_byte *loc;
srelgot = htab->srelgot;
if (srelgot == NULL)
+ sgot->output_offset + off);
outrel.r_addend = 0;
outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32);
- loc = (Elf32_External_Rela *) srelgot->contents;
- loc += srelgot->reloc_count++;
+ loc = srelgot->contents;
+ loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela);
bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
htab->tls_ldm_got.offset |= 1;
}
{
int indx;
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
if (sreloc == NULL)
{
outrel.r_addend = relocation - dtpoff_base (info);
else
outrel.r_addend = 0;
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue;
}
else
{
int indx;
Elf_Internal_Rela outrel;
+ bfd_byte *loc;
if (sreloc == NULL)
{
outrel.r_addend = relocation - dtpoff_base (info);
else
outrel.r_addend = 0;
- bfd_elf32_swap_reloca_out (output_bfd, &outrel,
- (((Elf32_External_Rela *)
- sreloc->contents)
- + sreloc->reloc_count));
- ++sreloc->reloc_count;
+ loc = sreloc->contents;
+ loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
continue;
}
}
bfd_vma plt_index;
bfd_vma got_offset;
Elf_Internal_Rela rel;
+ bfd_byte *loc;
/* This symbol has an entry in the procedure linkage table. Set
it up. */
#ifdef GOT_BIAS
rel.r_addend = GOT_BIAS;
#endif
- bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) srel->contents
- + plt_index));
+ loc = srel->contents + plt_index * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
{
asection *sgot;
asection *srel;
Elf_Internal_Rela rel;
+ bfd_byte *loc;
/* This symbol has an entry in the global offset table. Set it
up. */
rel.r_addend = 0;
}
- bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) srel->contents
- + srel->reloc_count));
- ++srel->reloc_count;
+ loc = srel->contents;
+ loc += srel->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
}
#ifdef INCLUDE_SHMEDIA
asection *sgot;
asection *srel;
Elf_Internal_Rela rel;
+ bfd_byte *loc;
/* This symbol has a datalabel entry in the global offset table.
Set it up. */
rel.r_addend = 0;
}
- bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) srel->contents
- + srel->reloc_count));
- ++srel->reloc_count;
+ loc = srel->contents;
+ loc += srel->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
}
}
#endif
{
asection *s;
Elf_Internal_Rela rel;
+ bfd_byte *loc;
/* This symbol needs a copy reloc. Set it up. */
+ h->root.u.def.section->output_offset);
rel.r_info = ELF32_R_INFO (h->dynindx, R_SH_COPY);
rel.r_addend = 0;
- bfd_elf32_swap_reloca_out (output_bfd, &rel,
- ((Elf32_External_Rela *) s->contents
- + s->reloc_count));
- ++s->reloc_count;
+ loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela);
+ bfd_elf32_swap_reloca_out (output_bfd, &rel, loc);
}
/* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */