]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Properly check building shared library
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Feb 2018 22:31:53 +0000 (14:31 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Feb 2018 22:32:06 +0000 (14:32 -0800)
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/ChangeLog
bfd/elfxx-x86.c

index 726225ac23f2c518d0aa06126079927b3c2870dc..77cdfe86bc8806538f7535d3da052fed75dbe875 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
+       instead of bfd_link_pic, for building shared library.
+
 2018-02-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR gas/22791
index fc08d1b977fc9a238bc57693caefd267bf5a656c..bd36707fc03f3770a24233e1e75bf1505abfeaaa 100644 (file)
@@ -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)