* 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.
This commit is contained in:
Hans-Peter Nilsson 2008-12-20 00:26:36 +00:00
parent 7a0cc8edf5
commit 75f500d75d
5 changed files with 43 additions and 6 deletions

View File

@ -1,3 +1,12 @@
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

View File

@ -4213,6 +4213,7 @@ This is the 5 bits of a value. */
BFD_RELOC_CRIS_32_TPREL,
BFD_RELOC_CRIS_16_TPREL,
BFD_RELOC_CRIS_DTPMOD,
BFD_RELOC_CRIS_32_IE,
/* Intel i860 Relocations. */
BFD_RELOC_860_COPY,

View File

@ -436,7 +436,8 @@ static reloc_howto_type cris_elf_howto_table [] =
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)
};
/* Map BFD reloc types to CRIS ELF reloc types. */
@ -479,7 +480,8 @@ static const struct cris_reloc_map cris_reloc_map [] =
{ 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 *
@ -1832,6 +1834,17 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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)
@ -1884,7 +1897,8 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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
{
@ -1944,10 +1958,12 @@ cris_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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:
@ -2559,6 +2575,7 @@ cris_elf_gc_sweep_hook (bfd *abfd,
: &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
@ -2572,6 +2589,7 @@ cris_elf_gc_sweep_hook (bfd *abfd,
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:
@ -3115,6 +3133,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
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:
@ -3188,6 +3207,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
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:
@ -3234,6 +3254,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
/* 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:
@ -3271,11 +3292,12 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
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)
@ -3306,6 +3328,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
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:
@ -3356,6 +3379,7 @@ cris_elf_check_relocs (abfd, info, sec, relocs)
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)

View File

@ -1904,6 +1904,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_CRIS_32_TPREL",
"BFD_RELOC_CRIS_16_TPREL",
"BFD_RELOC_CRIS_DTPMOD",
"BFD_RELOC_CRIS_32_IE",
"BFD_RELOC_860_COPY",
"BFD_RELOC_860_GLOB_DAT",
"BFD_RELOC_860_JUMP_SLOT",

View File

@ -4746,6 +4746,8 @@ ENUMX
BFD_RELOC_CRIS_16_TPREL
ENUMX
BFD_RELOC_CRIS_DTPMOD
ENUMX
BFD_RELOC_CRIS_32_IE
ENUMDOC
Relocs used in TLS code for CRIS.