aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2014-12-02 16:57:45 -0800
committerH.J. Lu <hjl.tools@gmail.com>2014-12-02 16:58:22 -0800
commitfd9edc908915788839e7605e2fe4c00f4b3eb3db (patch)
treebc6209642676778a8f8195316f814511c34e5ded /bfd
parent7c5fdd25ebe3262695084d93027f313e1015518a (diff)
downloadgdb-fd9edc908915788839e7605e2fe4c00f4b3eb3db.zip
gdb-fd9edc908915788839e7605e2fe4c00f4b3eb3db.tar.gz
gdb-fd9edc908915788839e7605e2fe4c00f4b3eb3db.tar.bz2
Check info->executable for symbols which need copy relocs
* elf64-x86-64.c (elf_x86_64_relocate_section): Check info->executable for symbols which need copy relocs.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-x86-64.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 91245b9..f7caed5 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2014-12-02 H.J. Lu <hongjiu.lu@intel.com>
+ * elf64-x86-64.c (elf_x86_64_relocate_section): Check
+ info->executable for symbols which need copy relocs.
+
+2014-12-02 H.J. Lu <hongjiu.lu@intel.com>
+
* elf64-x86-64.c (elf_x86_64_check_relocs): Revert the last
change.
(elf_x86_64_adjust_dynamic_symbol): Don't check !info->shared
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 58db76a..8b0b8bf 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -4059,7 +4059,7 @@ elf_x86_64_relocate_section (bfd *output_bfd,
defined locally or for a branch. */
fail = !h->def_regular && !branch;
}
- else if (!h->needs_copy)
+ else if (!(info->executable && h->needs_copy))
{
/* Symbol doesn't need copy reloc and isn't referenced
locally. We only allow branch to symbol with
@@ -4120,7 +4120,8 @@ direct:
/* Don't copy a pc-relative relocation into the output file
if the symbol needs copy reloc. */
if ((info->shared
- && !(h != NULL
+ && !(info->executable
+ && h != NULL
&& h->needs_copy
&& IS_X86_64_PCREL_TYPE (r_type))
&& (h == NULL