2003-07-18 H.J. Lu <hongjiu.lu@intel.com>
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 19 Jul 2003 04:12:22 +0000 (04:12 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 19 Jul 2003 04:12:22 +0000 (04:12 +0000)
* elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
(SYMBOL_CALLS_LOCAL): Likewise.

* elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
immediately if symbol isn't defined locally.

bfd/ChangeLog
bfd/elf-bfd.h
bfd/elflink.c

index adb20cfa582c43df99e3271e47f81c2bf5288688..de3fd64280776642720e1c6873631c65e001a297 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-18  H.J. Lu <hongjiu.lu@intel.com>
+
+       * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo.
+       (SYMBOL_CALLS_LOCAL): Likewise.
+
+       * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE
+       immediately if symbol isn't defined locally.
+
 2003-07-18  Richard Henderson  <rth@redhat.com>
 
        * elflink.c (_bfd_elf_dynamic_symbol_p): New.
index 7d154fc735cf859904f5f228631bfaacdb15e6d4..2fc64abb7e7dc8b1f6db873cc0ce44f28ca3c153 100644 (file)
@@ -212,11 +212,11 @@ struct elf_link_hash_entry
    it's necessary for shared libs to also reference the .plt even
    though the symbol is really local to the shared lib.  */
 #define SYMBOL_REFERENCES_LOCAL(INFO, H) \
-  _bfd_elf_dynamic_symbol_p (H, INFO, 1)
+  !_bfd_elf_dynamic_symbol_p (H, INFO, 1)
 
 /* Will _calls_ to this symbol always call the version in this object?  */
 #define SYMBOL_CALLS_LOCAL(INFO, H) \
-  _bfd_elf_dynamic_symbol_p (H, INFO, 0)
+  !_bfd_elf_dynamic_symbol_p (H, INFO, 0)
 
 /* Records local symbols to be emitted in the dynamic symbol table.  */
 
index 2fd588ae1101c2873d09d79386037780494b32a8..744641433c8f7de65671f7a145228723fa31ec1f 100644 (file)
@@ -2494,6 +2494,10 @@ _bfd_elf_dynamic_symbol_p (h, info, ignore_protected)
         || h->root.type == bfd_link_hash_warning)
     h = (struct elf_link_hash_entry *) h->root.u.i.link;
 
+  /* If it isn't defined locally, then clearly it's dynamic.  */
+  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
+    return TRUE;
+
   /* If it was forced local, then clearly it's not dynamic.  */
   if (h->dynindx == -1)
     return FALSE;
@@ -2526,10 +2530,6 @@ _bfd_elf_dynamic_symbol_p (h, info, ignore_protected)
       break;
     }
 
-  /* If it isn't defined locally, then clearly it's dynamic.  */
-  if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)
-    return TRUE;
-
   /* Otherwise, the symbol is dynamic if binding rules don't tell
      us that it remains local.  */
   return !binding_stays_local_p;