]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2001-02-14 Philip Blundell <pb@futuretv.com>
authorPhil Blundell <philb@gnu.org>
Wed, 14 Feb 2001 09:43:10 +0000 (09:43 +0000)
committerPhil Blundell <philb@gnu.org>
Wed, 14 Feb 2001 09:43:10 +0000 (09:43 +0000)
From 2001-02-08  H.J. Lu  <hjl@gnu.org>
* elf32-i386.c (elf_i386_check_relocs): Reserve R_386_32
relocation entries for weak definitions when building DSO with
-Bsymbolic.

bfd/ChangeLog
bfd/elf32-i386.c

index 69871792ddc4b4ae2f5786ca0d1f792c3dc6325d..b07627fc64022f186e456f95535800998334c637 100644 (file)
@@ -1,3 +1,10 @@
+2001-02-14  Philip Blundell  <pb@futuretv.com>
+
+       From 2001-02-08  H.J. Lu  <hjl@gnu.org>
+       * elf32-i386.c (elf_i386_check_relocs): Reserve R_386_32
+       relocation entries for weak definitions when building DSO with
+       -Bsymbolic.
+
 2001-02-13  Richard Henderson  <rth@redhat.com>
 
        * elfxx-ia64.c (elfNN_ia64_final_link): Set __gp if required
index b433c25d63527f81b00200c8ec8ebd1d1edf812d..4ad2c2be6aa4f2689613f3e4b778818503d35d1e 100644 (file)
@@ -643,16 +643,19 @@ elf_i386_check_relocs (abfd, info, sec, relocs)
             including in the link (i.e., DEF_REGULAR is set).  At
             this point we have not seen all the input files, so it is
             possible that DEF_REGULAR is not set now but will be set
-            later (it is never cleared).  We account for that
-            possibility below by storing information in the
-            pcrel_relocs_copied field of the hash table entry.
-            A similar situation occurs when creating shared libraries
-            and symbol visibility changes render the symbol local.  */
+            later (it is never cleared).  In case of a weak definition,
+            DEF_REGULAR may be cleared later by a strong definition in
+            a shared library. We account for that possibility below by
+            storing information in the relocs_copied field of the hash
+            table entry.  A similar situation occurs when creating
+            shared libraries and symbol visibility changes render the
+            symbol local.  */
          if (info->shared
              && (sec->flags & SEC_ALLOC) != 0
              && (ELF32_R_TYPE (rel->r_info) != R_386_PC32
                  || (h != NULL
                      && (! info->symbolic
+                         || h->root.type == bfd_link_hash_defweak
                          || (h->elf_link_hash_flags
                              & ELF_LINK_HASH_DEF_REGULAR) == 0))))
            {