From ad71ce8de7dba823f5fc478e6d5eba03f1a2e822 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 1 Sep 2017 18:53:26 -0700 Subject: x86-64: Check ELF_COMMON_DEF_P for common symbols bfd/ PR ld/22064 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check ELF_COMMON_DEF_P for common symbols. ld/ PR ld/22064 * testsuite/ld-x86-64/pr22064a.S: New file. * testsuite/ld-x86-64/pr22064b.c: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run PR ld/22064 test. --- bfd/elf64-x86-64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd/elf64-x86-64.c') diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 63aff46..26ab715 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -5330,7 +5330,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, else if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { - 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 = htab->r_info (0, R_X86_64_RELATIVE); -- cgit v1.1