From 8170f7693bc0a9442c0aa280197925db92d48ca6 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 7 Apr 2017 07:40:14 -0700 Subject: ELF: Check ELF_COMMON_DEF_P for common symbols Since common symbols that are turned into definitions don't have the DEF_REGULAR flag set, we need to check ELF_COMMON_DEF_P for common symbols. bfd/ PR ld/19579 PR ld/21306 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check ELF_COMMON_DEF_P for common symbols. * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elflink.c (_bfd_elf_merge_symbol): Revert commits 202ac193bbbecc96a4978d1ac3d17148253f9b01 and 07492f668d2173da7a2bda3707ff0985e0f460b6. ld/ PR ld/19579 PR ld/21306 * testsuite/ld-elf/pr19579a.c (main): Updated. --- bfd/elf32-s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/elf32-s390.c') diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index fd1bc13d5c..ddb6f5b255 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -3785,7 +3785,7 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd, RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - if (!h->def_regular) + if (!(h->def_regular || ELF_COMMON_DEF_P (h))) return FALSE; BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); -- cgit v1.2.3