Rename u.weakdef and make it a circular list
[deliverable/binutils-gdb.git] / bfd / elfxx-sparc.c
index 873062d23dbd199ad6895048b5401b061b9e5d48..856adebbac605c8584937b9f935a296d9d4c1244 100644 (file)
@@ -1932,8 +1932,8 @@ _bfd_sparc_elf_gc_mark_hook (asection *sec,
                                    FALSE, FALSE, TRUE);
          BFD_ASSERT (h != NULL);
          h->mark = 1;
-         if (h->u.weakdef != NULL)
-           h->u.weakdef->mark = 1;
+         if (h->is_weakalias)
+           weakdef (h)->mark = 1;
          sym = NULL;
        }
     }
@@ -1995,7 +1995,7 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   BFD_ASSERT (htab->elf.dynobj != NULL
              && (h->needs_plt
                  || h->type == STT_GNU_IFUNC
-                 || h->u.weakdef != NULL
+                 || h->is_weakalias
                  || (h->def_dynamic
                      && h->ref_regular
                      && !h->def_regular)));
@@ -2038,12 +2038,12 @@ _bfd_sparc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
   /* If this is a weak symbol, and there is a real definition, the
      processor independent code will have arranged for us to see the
      real definition first, and we can just use the same value.  */
-  if (h->u.weakdef != NULL)
+  if (h->is_weakalias)
     {
-      BFD_ASSERT (h->u.weakdef->root.type == bfd_link_hash_defined
-                 || h->u.weakdef->root.type == bfd_link_hash_defweak);
-      h->root.u.def.section = h->u.weakdef->root.u.def.section;
-      h->root.u.def.value = h->u.weakdef->root.u.def.value;
+      struct elf_link_hash_entry *def = weakdef (h);
+      BFD_ASSERT (def->root.type == bfd_link_hash_defined);
+      h->root.u.def.section = def->root.u.def.section;
+      h->root.u.def.value = def->root.u.def.value;
       return TRUE;
     }
 
This page took 0.028492 seconds and 4 git commands to generate.