+2008-12-20 Hans-Peter Nilsson <hp@axis.com>
+
+ * elf32-cris.c (cris_elf_howto_table): Add entry for R_CRIS_32_IE.
+ (cris_reloc_map): Similarly.
+ (cris_elf_relocate_section, cris_elf_gc_sweep_hook)
+ (cris_elf_check_relocs): Handle R_CRIS_32_IE.
+ * reloc.c (bfd_reloc_code_type): Add entry for R_CRIS_32_IE.
+ * bfd-in2.h, libbfd.h: Regenerate.
+
2008-12-17 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (elf_cris_copy_indirect_symbol): Return without
TLSHOWTO16S (R_CRIS_16_GOT_TPREL),
TLSHOWTO32 (R_CRIS_32_TPREL),
TLSHOWTO16S (R_CRIS_16_TPREL),
- TLSHOWTO32 (R_CRIS_DTPMOD)
+ TLSHOWTO32 (R_CRIS_DTPMOD),
+ TLSHOWTO32 (R_CRIS_32_IE)
};
\f
/* Map BFD reloc types to CRIS ELF reloc types. */
{ BFD_RELOC_CRIS_16_GOT_TPREL, R_CRIS_16_GOT_TPREL },
{ BFD_RELOC_CRIS_32_TPREL, R_CRIS_32_TPREL },
{ BFD_RELOC_CRIS_16_TPREL, R_CRIS_16_TPREL },
- { BFD_RELOC_CRIS_DTPMOD, R_CRIS_DTPMOD }
+ { BFD_RELOC_CRIS_DTPMOD, R_CRIS_DTPMOD },
+ { BFD_RELOC_CRIS_32_IE, R_CRIS_32_IE }
};
static reloc_howto_type *
the GOT entry. */
break;
+ case R_CRIS_32_IE:
+ if (info->shared)
+ {
+ bfd_set_error (bfd_error_invalid_operation);
+
+ /* We've already informed in cris_elf_check_relocs that
+ this is an error. */
+ return FALSE;
+ }
+ /* Fall through. */
+
case R_CRIS_32_GOT_TPREL:
case R_CRIS_16_GOT_TPREL:
if (rel->r_addend != 0)
else
off &= ~3;
- relocation = sgot->output_offset + off;
+ relocation = sgot->output_offset + off
+ + (r_type == R_CRIS_32_IE ? sgot->output_section->vma : 0);
}
else
{
else
off &= ~3;
- relocation = sgot->output_offset + off;
+ relocation = sgot->output_offset + off
+ + (r_type == R_CRIS_32_IE ? sgot->output_section->vma : 0);
}
- /* The GOT-relative offset to the GOT entry is the relocation. */
+ /* The GOT-relative offset to the GOT entry is the relocation,
+ or for R_CRIS_32_GD, the actual address of the GOT entry. */
break;
case R_CRIS_16_TPREL:
: &local_got_refcounts[LGOT_DTP_NDX (r_symndx)];
break;
+ case R_CRIS_32_IE:
case R_CRIS_16_GOT_TPREL:
case R_CRIS_32_GOT_TPREL:
specific_refcount = h != NULL
switch (r_type)
{
+ case R_CRIS_32_IE:
case R_CRIS_32_GD:
case R_CRIS_16_GOT_TPREL:
case R_CRIS_32_GOT_TPREL:
elf_cris_hash_table (info)->dtpmod_refcount++;
/* Fall through. */
+ case R_CRIS_32_IE:
case R_CRIS_32_GD:
case R_CRIS_16_GOT_GD:
case R_CRIS_32_GOT_GD:
break;
/* Fall through. */
+ case R_CRIS_32_IE:
case R_CRIS_32_GD:
case R_CRIS_16_GOT_GD:
case R_CRIS_32_GOT_GD:
/* Warn and error for invalid input. */
switch (r_type)
{
+ case R_CRIS_32_IE:
case R_CRIS_32_TPREL:
case R_CRIS_16_TPREL:
case R_CRIS_32_GD:
elsewhere. */
break;
+ case R_CRIS_32_IE:
case R_CRIS_32_GOT_TPREL:
case R_CRIS_16_GOT_TPREL:
r_symndx_lgot = LGOT_TPREL_NDX (r_symndx);
- /* Those two relocs also require that a DSO is of type
+ /* Those relocs also require that a DSO is of type
Initial Exec. Like other targets, we don't reset this
flag even if the relocs are GC:ed away. */
if (info->shared)
GOT entry for it, so handle it like a GOT reloc. */
/* Fall through. */
+ case R_CRIS_32_IE:
case R_CRIS_32_GD:
case R_CRIS_16_GOT_GD:
case R_CRIS_32_GOT_GD:
elf_cris_hash_entry (h)->dtp_refcount++;
break;
+ case R_CRIS_32_IE:
case R_CRIS_32_GOT_TPREL:
case R_CRIS_16_GOT_TPREL:
if (elf_cris_hash_entry (h)->tprel_refcount == 0)