This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed, PATCH] x86: Properly check building shared library
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Tue, 13 Feb 2018 14:31:43 -0800
- Subject: [committed, PATCH] x86: Properly check building shared library
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
If a symbol is not defined in a regular file, and we are not generating
a shared library, then set the symbol to its location in the .plt. This
is required to make function pointers compare as equal between the normal
executable and the shared library.
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
instead of bfd_link_pic, for building shared library.
---
bfd/elfxx-x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c
index fc08d1b977..bd36707fc0 100644
--- a/bfd/elfxx-x86.c
+++ b/bfd/elfxx-x86.c
@@ -200,7 +200,7 @@ elf_x86_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
location in the .plt. This is required to make function
pointers compare as equal between the normal executable and
the shared library. */
- if (! bfd_link_pic (info)
+ if (! bfd_link_dll (info)
&& !h->def_regular)
{
if (use_plt_got)
--
2.14.3