Add support for a 16 bit reloc against the TDA pointer!
authorNick Clifton <nickc@redhat.com>
Tue, 16 Sep 1997 21:21:30 +0000 (21:21 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 16 Sep 1997 21:21:30 +0000 (21:21 +0000)
bfd/ChangeLog
bfd/bfd-in2.h
bfd/elf32-v850.c
bfd/libbfd.h
bfd/reloc.c

index 7531a36eb99cb74f089cbb293c48cc48521326a4..bae50f89685ed7a543c680673c42228d3e1e1761 100644 (file)
@@ -1,3 +1,11 @@
+Tue Sep 16 14:20:27 1997  Nick Clifton  <nickc@cygnus.com>
+
+       * reloc.c: Add BFR_RELOC_V850_TDA_16_16_OFFSET.
+
+       * elf32-v850.c (v850_elf_reloc, v850_elf_final_link_relocate,
+       v850_elf_howto_table, v850_elf_reloc_map): Add support for a 16
+       bit reloc in the tiny data area.
+
 start-sanitize-d30v
 Mon Sep 15 11:27:36 1997  Ken Raeburn  <raeburn@cygnus.com>
 
index 4d0ac3353e2b07eed9e5088bacf16e7734bb1e75..b1175321018ac1388c4c4afac8414c8b25838673 100644 (file)
@@ -1989,6 +1989,9 @@ data area pointer. */
 
 /* This is a 7 bit offset from the tiny data area pointer. */
   BFD_RELOC_V850_TDA_7_7_OFFSET,
+
+/* This is a 16 bit offset from the tiny data area pointer. */
+  BFD_RELOC_V850_TDA_16_16_OFFSET,
 /* start-sanitize-v850e */
 
 /* This is a 5 bit offset (of which only 4 bits are used) from the tiny
index 4dbfe5e95763d691fcc0b771280e702385f92cea..feb298e4da0790e42e775bfd1fd3b82673faab0d 100644 (file)
@@ -293,6 +293,21 @@ static reloc_howto_type v850_elf_howto_table[] =
         0x7f,                          /* dst_mask */
         false),                        /* pcrel_offset */
 
+  /* 16 bit offset from the tiny data area pointer!  */
+  HOWTO (R_V850_TDA_16_16_OFFSET,      /* type */
+        0,                             /* rightshift */
+        1,                             /* size (0 = byte, 1 = short, 2 = long) */
+        16,                            /* bitsize */
+        false,                         /* pc_relative */
+        0,                             /* bitpos */
+        complain_overflow_dont,        /* complain_on_overflow */
+        v850_elf_reloc,                /* special_function */
+        "R_V850_TDA_16_16_OFFSET",     /* name */
+        false,                         /* partial_inplace */
+        0xffff,                        /* src_mask */
+        0xfff,                         /* dst_mask */
+        false),                        /* pcrel_offset */
+
 /* start-sanitize-v850e */
   
   /* 5 bit offset from the tiny data area pointer.  */
@@ -384,6 +399,7 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] =
   { BFD_RELOC_V850_TDA_6_8_OFFSET,   R_V850_TDA_6_8_OFFSET },
   { BFD_RELOC_V850_TDA_7_8_OFFSET,   R_V850_TDA_7_8_OFFSET },
   { BFD_RELOC_V850_TDA_7_7_OFFSET,   R_V850_TDA_7_7_OFFSET },
+  { BFD_RELOC_V850_TDA_16_16_OFFSET, R_V850_TDA_16_16_OFFSET },
 /* start-sanitize-v850e */
   { BFD_RELOC_V850_TDA_4_5_OFFSET,         R_V850_TDA_4_5_OFFSET },
   { BFD_RELOC_V850_TDA_4_4_OFFSET,         R_V850_TDA_4_4_OFFSET },
@@ -520,6 +536,7 @@ v850_elf_check_relocs (abfd, info, sec, relocs)
        case R_V850_TDA_6_8_OFFSET:
        case R_V850_TDA_7_8_OFFSET:
        case R_V850_TDA_7_7_OFFSET:
+       case R_V850_TDA_16_16_OFFSET:
          other = V850_OTHER_TDA;
          common = ".tcommon";
          /* fall through */
@@ -716,6 +733,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err)
       
     case R_V850_SDA_16_16_OFFSET:
     case R_V850_ZDA_16_16_OFFSET:
+    case R_V850_TDA_16_16_OFFSET:
       if ((long)relocation > 0x7fff || (long)relocation < -0x8000)
        return bfd_reloc_overflow;
       bfd_put_16 (abfd, relocation, (bfd_byte *)data + reloc->address);
@@ -1115,6 +1133,31 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
        return bfd_reloc_ok;
       }
     
+    case R_V850_TDA_16_16_OFFSET:
+      {
+       unsigned long                ep;
+       struct bfd_link_hash_entry * h;
+
+       /* Get the value of __ep.  */
+       h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true);
+       if (h == (struct bfd_link_hash_entry *) NULL
+           || h->type != bfd_link_hash_defined)
+         return bfd_reloc_other;
+
+       ep = (h->u.def.value
+             + h->u.def.section->output_section->vma
+             + h->u.def.section->output_offset);
+       value -= ep;
+       
+       value += (short) bfd_get_16 (input_bfd, hit_data);
+
+       if ((long)value > 0x7fff || (long)value < -0x8000)
+         return bfd_reloc_overflow;
+
+       bfd_put_16 (input_bfd, value, hit_data);
+       return bfd_reloc_ok;
+      }
+
 /* start-sanitize-v850e */
     case R_V850_TDA_4_5_OFFSET:
       {
index c6f9ccc9078abf892050a75e934ab4a6917c2d65..f22f322161f60847ae6f9c2aecaa5184337f955d 100644 (file)
@@ -781,6 +781,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_V850_TDA_6_8_OFFSET",
   "BFD_RELOC_V850_TDA_7_8_OFFSET",
   "BFD_RELOC_V850_TDA_7_7_OFFSET",
+  "BFD_RELOC_V850_TDA_16_16_OFFSET",
 /* start-sanitize-v850e */
   "BFD_RELOC_V850_TDA_4_5_OFFSET",
   "BFD_RELOC_V850_TDA_4_4_OFFSET",
index e878ce367130145bef61d0f9c92502491214e95a..9e31e49a57c737107c7690f599ac95950f7a2a4f 100644 (file)
@@ -2414,6 +2414,10 @@ ENUM
   BFD_RELOC_V850_TDA_7_7_OFFSET
 ENUMDOC
   This is a 7 bit offset from the tiny data area pointer.
+ENUM
+  BFD_RELOC_V850_TDA_16_16_OFFSET
+ENUMDOC
+  This is a 16 bit offset from the tiny data area pointer.
 COMMENT
 {* start-sanitize-v850e *}
 ENUM
This page took 0.040144 seconds and 4 git commands to generate.