diff options
author | Andreas Jaeger <aj@suse.de> | 2001-06-21 16:33:14 +0000 |
---|---|---|
committer | Andreas Jaeger <aj@suse.de> | 2001-06-21 16:33:14 +0000 |
commit | f631948d0b929cf4a36bca085e8c85230dc694c2 (patch) | |
tree | 67d41cf5102d5f6ead98ac2e22bdcf5c596eec06 /bfd/elf64-x86-64.c | |
parent | a7c14aa534277d20e70a657c9d9298a517268c3c (diff) | |
download | gdb-f631948d0b929cf4a36bca085e8c85230dc694c2.zip gdb-f631948d0b929cf4a36bca085e8c85230dc694c2.tar.gz gdb-f631948d0b929cf4a36bca085e8c85230dc694c2.tar.bz2 |
* elf64-x86-64.c (elf64_x86_64_relocate_section): Fix linking of
shared libraries.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r-- | bfd/elf64-x86-64.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 57d4005..7b37d96 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1442,7 +1442,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: @@ -1451,15 +1453,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; @@ -1563,10 +1557,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; + } } |