This is the mail archive of the binutils-cvs@sourceware.org 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]
Other format: [Raw text]

[binutils-gdb/binutils-2_27-branch] PowerPC64 ELFv1 undefined weak functions


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e4aa8a9f60398eacd04398bcc51d7be5f93ed4eb

commit e4aa8a9f60398eacd04398bcc51d7be5f93ed4eb
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Aug 11 12:30:52 2016 +0930

    PowerPC64 ELFv1 undefined weak functions
    
    Undefined weak functions, like __gmon_start__, were not being made
    dynamic or emitting plt call code.  While the behaviour of undefined
    weak symbols is not defined in the ELF standard, the intention on
    powerpc64 was to make it possible to link without a definition of such
    symbols and at run time behave the same as if a definition was found
    at link time in a shared library.
    
    	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't exit with
    	non_got_ref true in any case where we could have generated dynbss
    	copies but decide not to do so.

Diff:
---
 bfd/ChangeLog   |  6 ++++++
 bfd/elf64-ppc.c | 31 +++++++++++--------------------
 2 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 48d41e5..363ec11 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-08-11  Alan Modra  <amodra@gmail.com>
+
+	* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't exit with
+	non_got_ref true in any case where we could have generated dynbss
+	copies but decide not to do so.
+
 2016-08-02  Nick Clifton  <nickc@redhat.com>
 
 	PR ld/17739
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index d7af888..cd9fda9 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -7223,29 +7223,20 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
     return TRUE;
 
   /* Don't generate a copy reloc for symbols defined in the executable.  */
-  if (!h->def_dynamic || !h->ref_regular || h->def_regular)
-    return TRUE;
+  if (!h->def_dynamic || !h->ref_regular || h->def_regular
 
-  /* If -z nocopyreloc was given, don't generate them either.  */
-  if (info->nocopyreloc)
-    {
-      h->non_got_ref = 0;
-      return TRUE;
-    }
+      /* If -z nocopyreloc was given, don't generate them either.  */
+      || info->nocopyreloc
 
-  /* If we didn't find any dynamic relocs in read-only sections, then
-     we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
-  if (ELIMINATE_COPY_RELOCS && !readonly_dynrelocs (h))
-    {
-      h->non_got_ref = 0;
-      return TRUE;
-    }
+      /* If we didn't find any dynamic relocs in read-only sections, then
+	 we'll be keeping the dynamic relocs and avoiding the copy reloc.  */
+      || (ELIMINATE_COPY_RELOCS && !readonly_dynrelocs (h))
 
-  /* Protected variables do not work with .dynbss.  The copy in
-     .dynbss won't be used by the shared library with the protected
-     definition for the variable.  Text relocations are preferable
-     to an incorrect program.  */
-  if (h->protected_def)
+      /* Protected variables do not work with .dynbss.  The copy in
+	 .dynbss won't be used by the shared library with the protected
+	 definition for the variable.  Text relocations are preferable
+	 to an incorrect program.  */
+      || h->protected_def)
     {
       h->non_got_ref = 0;
       return TRUE;


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