* elf32-cris.c (cris_elf_howto_table): Add entry for R_CRIS_32_IE.
authorHans-Peter Nilsson <hp@axis.com>
Sat, 20 Dec 2008 00:26:36 +0000 (00:26 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Sat, 20 Dec 2008 00:26:36 +0000 (00:26 +0000)
(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.

bfd/ChangeLog
bfd/bfd-in2.h
bfd/elf32-cris.c
bfd/libbfd.h
bfd/reloc.c

index 3d7241afa079571abcf5f337c9311ea8bcacc84b..f7a246cf39314d115a6f61b86d9785375eb93759 100644 (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
index b1451c9e56a93e9dae89dae37b1db527e4ead9ff..37c24b7eed7462d5057a6aedcaa34bf108c0daba 100644 (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,
index 1f4b0ddda6b5ac21d47e82a50fa3ec03f1c0cf66..c29768932118eacf086bbc44c10ea66faf4f1b15 100644 (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)
 };
 \f
 /* 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)
index 41b453a8a8cc9104372ffa09bd726a7f34f3e9b9..e35ff2173e03702c5ddfb945196c2ceee95fd286 100644 (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",
index d1f1f4de75bd538ac25c4d0d5a016085464b4e1a..626934037009a40c2c2ec4183694d5026659208f 100644 (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.
 
This page took 0.034536 seconds and 4 git commands to generate.