powerpc64 dot-sym fix

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

powerpc64 dot-sym fix

Alan Modra
A bug introduced 2005-02-06 that escaped my notice because the newly
built ld wasn't being tested.  gcc -Btmpdir/ld/ doesn't always work.
See http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00143.html

        * elf64-ppc.c (add_symbol_adjust): Set sym visibility to most
        restrictive of func code and func descr for undefined syms as well
        as defined.

Daniel, is this too late to go on the branch?

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.207
diff -u -p -r1.207 elf64-ppc.c
--- bfd/elf64-ppc.c 19 May 2005 08:26:54 -0000 1.207
+++ bfd/elf64-ppc.c 2 Jun 2005 13:08:59 -0000
@@ -4159,9 +4159,7 @@ add_symbol_adjust (struct elf_link_hash_
       else
  fdh->elf.ref_regular = 1;
     }
-  else if (fdh != NULL
-   && (fdh->elf.root.type == bfd_link_hash_defined
-       || fdh->elf.root.type == bfd_link_hash_defweak))
+  else if (fdh != NULL)
     {
       unsigned entry_vis = ELF_ST_VISIBILITY (eh->elf.other) - 1;
       unsigned descr_vis = ELF_ST_VISIBILITY (fdh->elf.other) - 1;
@@ -4170,7 +4168,9 @@ add_symbol_adjust (struct elf_link_hash_
       else if (entry_vis > descr_vis)
  eh->elf.other += descr_vis - entry_vis;
 
-      if (eh->elf.root.type == bfd_link_hash_undefined)
+      if ((fdh->elf.root.type == bfd_link_hash_defined
+   || fdh->elf.root.type == bfd_link_hash_defweak)
+  && eh->elf.root.type == bfd_link_hash_undefined)
  {
   eh->elf.root.type = bfd_link_hash_undefweak;
   eh->was_undefined = 1;

--
Alan Modra
IBM OzLabs - Linux Technology Centre
Reply | Threaded
Open this post in threaded view
|

Re: powerpc64 dot-sym fix

Daniel Jacobowitz-2
On Thu, Jun 02, 2005 at 10:43:15PM +0930, Alan Modra wrote:
> A bug introduced 2005-02-06 that escaped my notice because the newly
> built ld wasn't being tested.  gcc -Btmpdir/ld/ doesn't always work.
> See http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00143.html
>
> * elf64-ppc.c (add_symbol_adjust): Set sym visibility to most
> restrictive of func code and func descr for undefined syms as well
> as defined.
>
> Daniel, is this too late to go on the branch?

No, it isn't; please do.

--
Daniel Jacobowitz
CodeSourcery, LLC