Move UNDEFWEAK_NO_DYNAMIC_RELOC to elf-bfd.h
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 17:19:30 +0000 (10:19 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 14 Oct 2017 17:20:30 +0000 (10:20 -0700)
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.

bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf32-ppc.c
bfd/elf64-ppc.c

index ecdb0e7e872de54a2f7350a867e77c8273643d6b..59bfdf05d67637ba7d1f0669fb487902f43f6eeb 100644 (file)
@@ -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.
index c3560ce4fc62043e0d4cfe1dac71dbd3f4975dbb..f0229d49d41d691d97b616873eb9a8e997441b59 100644 (file)
@@ -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.  */
index ceae344bee7df5f8f4e3bcfbfdcb646b3e8dbdb0..8b32b970cc778f97ff70bfa5f9829107b307e1c2 100644 (file)
@@ -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
index 2d25399b512b9743ee88e0be7137026980b2b155..3f6bff9c7a60341d2094da3202025bc02d69ac78 100644 (file)
@@ -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
This page took 0.037227 seconds and 4 git commands to generate.