aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2019-02-27 11:53:16 -0800
committerH.J. Lu <hjl.tools@gmail.com>2019-02-27 11:53:27 -0800
commit5cfe428cd1788be52a0af540f02b8f2705354d50 (patch)
tree0e1447ed315df9489fb256b01a4bf88b42a1da3b /bfd/elf64-x86-64.c
parent43ac54fca353ea8d77d56dc5ad9e049bbb9a81fb (diff)
downloadgdb-5cfe428cd1788be52a0af540f02b8f2705354d50.zip
gdb-5cfe428cd1788be52a0af540f02b8f2705354d50.tar.gz
gdb-5cfe428cd1788be52a0af540f02b8f2705354d50.tar.bz2
x86-64: Skip protected check on symbol defined by linker
Skip symbol defined by linker when checking copy reloc on protected symbol. bfd/ PR ld/24276 * elf64-x86-64.c (elf_x86_64_check_relocs): Skip symbol defined by linker when checking copy reloc on protected symbol. ld/ PR ld/24276 * testsuite/ld-i386/i386.exp: Run PR ld/24276 test. * testsuite/ld-x86-64/x86-64.exp: Likewise. * testsuite/ld-i386/pr24276.dso: New file. * testsuite/ld-i386/pr24276.warn: Likewise. * testsuite/ld-x86-64/pr24276.dso: Likewise. * testsuite/ld-x86-64/pr24276.warn: Likewise.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 6a4b366..e193f44 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -2238,6 +2238,8 @@ check_pic:
bfd_boolean no_copyreloc_p
= (info->nocopyreloc
|| (h != NULL
+ && !h->root.linker_def
+ && !h->root.ldscript_def
&& eh->def_protected
&& elf_has_no_copy_on_protected (h->root.u.def.section->owner)));
if ((sec->flags & SEC_ALLOC) != 0