* elflink.c (_bfd_elf_dynamic_symbol_p): Rename param. Make
authorAlan Modra <amodra@gmail.com>
Sat, 28 Aug 2010 04:04:16 +0000 (04:04 +0000)
committerAlan Modra <amodra@gmail.com>
Sat, 28 Aug 2010 04:04:16 +0000 (04:04 +0000)
common syms local.
(_bfd_elf_symbol_refs_local_p): Expand comment.
(elf_link_output_extsym): Fix style nit.

bfd/ChangeLog
bfd/elflink.c

index 003f0920f32fad7138e4f9e40ef1ccbd70268cd8..32cc17503773479a800b87cc5b1e96d955d433d5 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-28  Alan Modra  <amodra@gmail.com>
+
+       * elflink.c (_bfd_elf_dynamic_symbol_p): Rename param.  Make
+       common syms local.
+       (_bfd_elf_symbol_refs_local_p): Expand comment.
+       (elf_link_output_extsym): Fix style nit.
+
 2010-08-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * elf32-arm.c (elf32_arm_final_link): Process stub sections
index 28f012c2a20a44211ca561be4b5da60f6a176216..dd48c74978584a4b8a8d9c39ba2eb01801c69308 100644 (file)
@@ -2770,7 +2770,7 @@ _bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *h, void *data)
 bfd_boolean
 _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
                           struct bfd_link_info *info,
-                          bfd_boolean ignore_protected)
+                          bfd_boolean not_local_protected)
 {
   bfd_boolean binding_stays_local_p;
   const struct elf_backend_data *bed;
@@ -2809,7 +2809,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
       /* Proper resolution for function pointer equality may require
         that these symbols perhaps be resolved dynamically, even though
         we should be resolving them to the current module.  */
-      if (!ignore_protected || !bed->is_function_type (h->type))
+      if (!not_local_protected || !bed->is_function_type (h->type))
        binding_stays_local_p = TRUE;
       break;
 
@@ -2818,7 +2818,7 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
     }
 
   /* If it isn't defined locally, then clearly it's dynamic.  */
-  if (!h->def_regular)
+  if (!h->def_regular && !ELF_COMMON_DEF_P (h))
     return TRUE;
 
   /* Otherwise, the symbol is dynamic if binding rules don't tell
@@ -2829,7 +2829,15 @@ _bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h,
 /* Return true if the symbol referred to by H should be considered
    to resolve local to the current module, and false otherwise.  Differs
    from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of
-   undefined symbols and weak symbols.  */
+   undefined symbols.  The two functions are vitually identical except
+   for the place where forced_local and dynindx == -1 are tested.  If
+   either of those tests are true, _bfd_elf_dynamic_symbol_p will say
+   the symbol is local, while _bfd_elf_symbol_refs_local_p will say
+   the symbol is local only for defined symbols.
+   It might seem that _bfd_elf_dynamic_symbol_p could be rewritten as
+   !_bfd_elf_symbol_refs_local_p, except that targets differ in their
+   treatment of undefined weak symbols.  For those that do not make
+   undefined weak symbols dynamic, both functions may return false.  */
 
 bfd_boolean
 _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h,
@@ -8635,7 +8643,7 @@ elf_link_output_extsym (struct elf_link_hash_entry *h, void *data)
        ignore_undef = bed->elf_backend_ignore_undef_symbol (h);
 
       /* If we are reporting errors for this situation then do so now.  */
-      if (ignore_undef == FALSE
+      if (!ignore_undef
          && h->ref_dynamic
          && (!h->ref_regular || finfo->info->gc_sections)
          && ! elf_link_check_versioned_symbol (finfo->info, bed, h)
This page took 0.032655 seconds and 4 git commands to generate.