aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-09-06 13:34:30 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-09-06 13:34:44 -0700
commitd8457a04b71cbd642a00352dce0539fe1fe22dd4 (patch)
tree8186684ed03e5f53ef3cb15df1698b8ee8d37bdc /bfd/elf64-x86-64.c
parent22d6c51be8de9a091d89c0e11e6e140f333ade62 (diff)
downloadgdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.zip
gdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.tar.gz
gdb-d8457a04b71cbd642a00352dce0539fe1fe22dd4.tar.bz2
Resolve size relocation with copy relocation
We can resolve size relocation against symbol which needs copy relocation when building executable. bfd/ PR ld/20550 * elf64-x86-64.c (elf_x86_64_relocate_section): Resolve size relocation with copy relocation when building executable. ld/ PR ld/20550 * testsuite/ld-x86-64/pr20550a.s: New file. * testsuite/ld-x86-64/pr20550b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp (x86_64tests): Add tests for PR ld/20550.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index c8bbed8..9a6a5c7 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -4818,7 +4818,9 @@ direct:
&& (h->needs_copy
|| eh->needs_copy
|| h->root.type == bfd_link_hash_undefined)
- && IS_X86_64_PCREL_TYPE (r_type))
+ && (IS_X86_64_PCREL_TYPE (r_type)
+ || r_type == R_X86_64_SIZE32
+ || r_type == R_X86_64_SIZE64))
&& (h == NULL
|| ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
&& !resolved_to_zero)