This is the mail archive of the binutils@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]

[PATCH 2/2] ppc: Update UNDEFWEAK_NO_DYNAMIC_RELOC


UNDEFWEAK_NO_DYNAMIC_RELOC is the same as UNDEFINED_WEAK_RESOLVED_TO_ZERO.

	PR ld/22269
	* elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Defined as
	UNDEFINED_WEAK_RESOLVED_TO_ZERO.
	* elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Likewise.
---
 bfd/elf32-ppc.c | 4 +---
 bfd/elf64-ppc.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index bfd7e067b3..3cffd83c96 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -3245,9 +3245,7 @@ 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))
+  UNDEFINED_WEAK_RESOLVED_TO_ZERO ((INFO), (H))
 
 /* 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
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 53ea30e43b..0fc7bc6916 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -3838,9 +3838,7 @@ 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))
+  UNDEFINED_WEAK_RESOLVED_TO_ZERO ((INFO), (H))
 
 /* 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
-- 
2.13.6


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