aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-01 18:53:26 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-01 18:55:55 -0700
commitad71ce8de7dba823f5fc478e6d5eba03f1a2e822 (patch)
treec8b86f2fe104d14cd5f1f54f623e8bcf0f94cc0c /bfd/elf64-x86-64.c
parent96d01d93c4025cddeff197c98c7947e2b8f427bd (diff)
downloadgdb-ad71ce8de7dba823f5fc478e6d5eba03f1a2e822.zip
gdb-ad71ce8de7dba823f5fc478e6d5eba03f1a2e822.tar.gz
gdb-ad71ce8de7dba823f5fc478e6d5eba03f1a2e822.tar.bz2
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.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c2
1 files changed, 1 insertions, 1 deletions
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);