]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
authorAndreas Jaeger <aj@suse.de>
Fri, 22 Jun 2001 07:08:00 +0000 (07:08 +0000)
committerAndreas Jaeger <aj@suse.de>
Fri, 22 Jun 2001 07:08:00 +0000 (07:08 +0000)
        shared libraries.

bfd/ChangeLog
bfd/elf64-x86-64.c

index 6120490f714dd72827dcacd22df234e9006225ed..258371274e8206496ef3ca0d6e19ff31b2513043 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-20  Bo Thorsen  <bo@suse.co.uk>
+
+        * elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
+        shared libraries.
+
 2001-06-21  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Always
index 206e70c3a69426ea46c02d3602b40bb8d1ee07f5..61534681de438e2fee78c9921d5ca7e1ccbc5911 100644 (file)
@@ -1397,7 +1397,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_X86_64_PC8:
        case R_X86_64_PC16:
        case R_X86_64_PC32:
-         if (h == NULL)
+         if (h == NULL || h->dynindx == -1
+             || (info->symbolic
+                 && h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
            break;
          /* Fall through.  */
        case R_X86_64_8:
@@ -1406,15 +1408,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_X86_64_64:
          /* FIXME: The ABI says the linker should make sure the value is
             the same when it's zeroextended to 64 bit.  */
-         if (info->shared
-             && (input_section->flags & SEC_ALLOC) != 0
-             && ((r_type != R_X86_64_PC8
-                  && r_type != R_X86_64_PC16
-                  && r_type != R_X86_64_PC32)
-                 || (! info->symbolic
-                     || (h->elf_link_hash_flags
-                         & ELF_LINK_HASH_DEF_REGULAR) == 0)))
-
+         if (info->shared && (input_section->flags & SEC_ALLOC) != 0)
            {
              Elf_Internal_Rela outrel;
              boolean skip, relocate;
@@ -1518,10 +1512,10 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
                          BFD_ASSERT (indx > 0);
                        }
 
-                     relocate = false;
+                     relocate = false;
                      outrel.r_info = ELF64_R_INFO (indx, r_type);
-                     outrel.r_addend = relocation + rela->r_addend;
-                   }
+                     outrel.r_addend = relocation + rela->r_addend;
+                   }
 
                }