[binutils-gdb] Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h

H.J.Lu hjl@sourceware.org
Sat Oct 14 17:20:00 GMT 2017


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

commit 62cd30f167be56e68cb0a37789d400b47bbdbc6c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Oct 14 10:19:30 2017 -0700

    Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h
    
    Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h so that it can be used by
    other ELF linker backends.
    
    	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
    	* elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
    	* elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.

Diff:
---
 bfd/ChangeLog   | 6 ++++++
 bfd/elf-bfd.h   | 7 +++++++
 bfd/elf32-ppc.c | 7 -------
 bfd/elf64-ppc.c | 7 -------
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ecdb0e7..59bfdf0 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
+	* elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
+	* elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
+
 2017-10-12  James Bowman  <james.bowman@ftdichip.com>
 
 	* bfd-in2.h: Regenerate.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index c3560ce..f0229d4 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -266,6 +266,13 @@ struct elf_link_hash_entry
 #define SYMBOL_CALLS_LOCAL(INFO, H) \
   _bfd_elf_symbol_refs_local_p (H, INFO, 1)
 
+/* Whether an undefined weak symbol should resolve to its link-time
+   value, even in PIC or PIE objects.  */
+#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H)		\
+  ((H)->root.type == bfd_link_hash_undefweak		\
+   && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT	\
+       || (INFO)->dynamic_undefined_weak == 0))
+
 /* Common symbols that are turned into definitions don't have the
    DEF_REGULAR flag set, so they might appear to be undefined.
    Symbols defined in linker scripts also don't have DEF_REGULAR set.  */
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index ceae344..8b32b97 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3178,13 +3178,6 @@ must_be_dyn_reloc (struct bfd_link_info *info,
     }
 }
 
-/* Whether an undefined weak symbol should resolve to its link-time
-   value, even in PIC or PIE objects.  */
-#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H)		\
-  ((H)->root.type == bfd_link_hash_undefweak		\
-   && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT	\
-       || (INFO)->dynamic_undefined_weak == 0))
-
 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    copying dynamic variables from a shared lib into an app's dynbss
    section, and instead use a dynamic relocation to point into the
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 2d25399..3f6bff9 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3835,13 +3835,6 @@ must_be_dyn_reloc (struct bfd_link_info *info,
     }
 }
 
-/* Whether an undefined weak symbol should resolve to its link-time
-   value, even in PIC or PIE objects.  */
-#define UNDEFWEAK_NO_DYNAMIC_RELOC(INFO, H)		\
-  ((H)->root.type == bfd_link_hash_undefweak		\
-   && (ELF_ST_VISIBILITY ((H)->other) != STV_DEFAULT	\
-       || (INFO)->dynamic_undefined_weak == 0))
-
 /* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
    copying dynamic variables from a shared lib into an app's dynbss
    section, and instead use a dynamic relocation to point into the



More information about the Binutils-cvs mailing list