* elfxx-mips.c (MINUS_TWO): Define.
authorThiemo Seufer <ths@networkno.de>
Sat, 15 May 2004 18:58:05 +0000 (18:58 +0000)
committerThiemo Seufer <ths@networkno.de>
Sat, 15 May 2004 18:58:05 +0000 (18:58 +0000)
(mips_elf_higher, mips_elf_highest,
mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
some bfd_vma values.
(_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.

bfd/ChangeLog
bfd/elfxx-mips.c

index 157f79fd57b42e0d73c89e5f7e224c72625f7738..b4b1d91aedc694746eff3e2d10bc3d7d2d859a06 100644 (file)
@@ -1,3 +1,11 @@
+2004-05-15  Thiemo Seufer  <seufer@csv.ica.uni-stuttgart.de>
+
+       * elfxx-mips.c (MINUS_TWO): Define.
+       (mips_elf_higher, mips_elf_highest,
+       mips_elf_create_dynamic_relocation): Use MINUS_ONE and MINUS_TWO for
+       some bfd_vma values.
+       (_bfd_mips_elf_finish_dynamic_symbol): Likewise. Code cleanup.
+
 2004-05-14  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * som.c (log2): Rename to exact_log2.  Adjust all callers.
index e5226d9f2e7ae52b9b341d6c8d44807a8f70dbdf..21748f24f691684d923170207f4ee7f69800ac35 100644 (file)
@@ -587,6 +587,7 @@ static bfd *reldyn_sorting_bfd;
 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
    from smaller values.  Start with zero, widen, *then* decrement.  */
 #define MINUS_ONE      (((bfd_vma)0) - 1)
+#define MINUS_TWO      (((bfd_vma)0) - 2)
 
 /* The number of local .got entries we reserve.  */
 #define MIPS_RESERVED_GOTNO (2)
@@ -2822,7 +2823,7 @@ mips_elf_higher (bfd_vma value ATTRIBUTE_UNUSED)
   return ((value + (bfd_vma) 0x80008000) >> 32) & 0xffff;
 #else
   abort ();
-  return (bfd_vma) -1;
+  return MINUS_ONE;
 #endif
 }
 
@@ -2835,7 +2836,7 @@ mips_elf_highest (bfd_vma value ATTRIBUTE_UNUSED)
   return ((value + (((bfd_vma) 0x8000 << 32) | 0x80008000)) >> 48) & 0xffff;
 #else
   abort ();
-  return (bfd_vma) -1;
+  return MINUS_ONE;
 #endif
 }
 \f
@@ -3824,15 +3825,15 @@ mips_elf_create_dynamic_relocation (bfd *output_bfd,
       outrel[2].r_offset = outrel[0].r_offset;
       /* If we didn't need the relocation at all, this value will be
         -1.  */
-      if (outrel[0].r_offset == (bfd_vma) -1)
+      if (outrel[0].r_offset == MINUS_ONE)
        skip = TRUE;
     }
 #endif
 
-  if (outrel[0].r_offset == (bfd_vma) -1)
+  if (outrel[0].r_offset == MINUS_ONE)
     /* The relocation field has been deleted.  */
     skip = TRUE;
-  else if (outrel[0].r_offset == (bfd_vma) -2)
+  else if (outrel[0].r_offset == MINUS_TWO)
     {
       /* The relocation field has been converted into a relative value of
         some sort.  Functions like _bfd_elf_write_section_eh_frame expect
@@ -6545,15 +6546,13 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
                                     Elf_Internal_Sym *sym)
 {
   bfd *dynobj;
-  bfd_vma gval;
   asection *sgot;
   struct mips_got_info *g, *gg;
   const char *name;
 
   dynobj = elf_hash_table (info)->dynobj;
-  gval = sym->st_value;
 
-  if (h->plt.offset != (bfd_vma) -1)
+  if (h->plt.offset != MINUS_ONE)
     {
       asection *s;
       bfd_byte stub[MIPS_FUNCTION_STUB_SIZE];
@@ -6586,8 +6585,8 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
       /* The run-time linker uses the st_value field of the symbol
         to reset the global offset table entry for this external
         to its stub address when unlinking a shared object.  */
-      gval = s->output_section->vma + s->output_offset + h->plt.offset;
-      sym->st_value = gval;
+      sym->st_value = (s->output_section->vma + s->output_offset
+                      + h->plt.offset);
     }
 
   BFD_ASSERT (h->dynindx != -1
This page took 0.035848 seconds and 4 git commands to generate.