This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Your patch on 2001-01-26 is bad


On Wed, Feb 07, 2001 at 12:22:58PM -0800, H . J . Lu wrote:
> Before you change it back, please get the current glibc from CVS and
> build/check on both ia64 and alpaha. You should run the ELF visibility
> test in ld/testsuite also.

The following passes the glibc and ld tests.

There were two problems with my original change:

  * We considered protected symbols non-dynamic even if they were
    not defined locally.  Thus linking against a library with
    exported protected symbols would crash with -relax.

  * Apparently the ld testsuite has decreed that weak overrides
    hidden.  This is contrary to my intuition, but I guess I'll
    go along with it for now.


r~


	* elf64-alpha.c (alpha_elf_dynamic_symbol_p): Respect weakness
	before visibility.  Locally defined protected symbols are not
	dynamic.

Index: elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.21
diff -c -p -r1.21 elf64-alpha.c
*** elf64-alpha.c	2001/02/07 06:19:58	1.21
--- elf64-alpha.c	2001/02/09 00:22:38
*************** alpha_elf_dynamic_symbol_p (h, info)
*** 240,255 ****
  
    if (h->dynindx == -1)
      return false;
    switch (ELF_ST_VISIBILITY (h->other))
      {
!     case STV_INTERNAL:
      case STV_HIDDEN:
        return false;
      }
- 
-   if (h->root.type == bfd_link_hash_undefweak
-       || h->root.type == bfd_link_hash_defweak)
-     return true;
  
    if ((info->shared && !info->symbolic)
        || ((h->elf_link_hash_flags
--- 240,262 ----
  
    if (h->dynindx == -1)
      return false;
+ 
+   if (h->root.type == bfd_link_hash_undefweak
+       || h->root.type == bfd_link_hash_defweak)
+     return true;
+ 
    switch (ELF_ST_VISIBILITY (h->other))
      {
!     case STV_DEFAULT:
!       break;
      case STV_HIDDEN:
+     case STV_INTERNAL:
        return false;
+     case STV_PROTECTED:
+       if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)
+         return false;
+       break;
      }
  
    if ((info->shared && !info->symbolic)
        || ((h->elf_link_hash_flags

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]