diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2001-11-14 18:48:26 +0000 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2001-11-14 18:48:26 +0000 |
commit | 27018c3f6862711768dd744fc092752aa8864489 (patch) | |
tree | 0f82eb61a6a9820e6c69b4fdb8c384805ae0810f | |
parent | befc81ac1d52695f97ae20211a6f2fa7944e602a (diff) | |
download | gdb-27018c3f6862711768dd744fc092752aa8864489.zip gdb-27018c3f6862711768dd744fc092752aa8864489.tar.gz gdb-27018c3f6862711768dd744fc092752aa8864489.tar.bz2 |
* elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc"
scheme to get rid of an ugly complicated test.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-s390.c | 41 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 49 |
3 files changed, 10 insertions, 86 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 15cfb1c..afd3dec 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2001-11-14 Martin Schwidefsky <schwidefsky@de.ibm.com> + + * elf32-s390.c (elf_s390_relocate_section): Use the "unresolved_reloc" + scheme to get rid of an ugly complicated test. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + 2001-11-14 Andreas Jaeger <aj@suse.de> * cpu-i386.c (bfd_x86_64_arch_intel_syntax,bfd_x86_64_arch): Use diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index aeb9805..2153a4c 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1679,44 +1679,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if (r_type == R_390_GOTPC - || ((r_type == R_390_PLT16DBL - || r_type == R_390_PLT32) - && htab->splt != NULL - && h->plt.offset != (bfd_vma) -1) - || ((r_type == R_390_GOT12 - || r_type == R_390_GOT16 - || r_type == R_390_GOT32) - && elf_hash_table (info)->dynamic_sections_created - && (! info->shared - || (! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - && (r_type == R_390_8 - || r_type == R_390_16 - || r_type == R_390_32 - || r_type == R_390_PC16 - || r_type == R_390_PC16DBL - || r_type == R_390_PC32) - && ((input_section->flags & SEC_ALLOC) != 0 - /* DWARF will emit R_390_32 relocations in its - sections against symbols defined externally - in shared libraries. We can't do anything - with them here. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } - else if (sec->output_section == NULL) + if (sec->output_section == NULL) { /* Set a flag that will be cleared later if we find a relocation value for this symbol. output_section @@ -1963,7 +1926,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, { relocate = false; outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_addend = rel->r_addend; } else { diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index e0a18cd..f4c1075 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1658,52 +1658,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; - if (r_type == R_390_GOTPC - || r_type == R_390_GOTPCDBL - || ((r_type == R_390_PLT16DBL - || r_type == R_390_PLT32 - || r_type == R_390_PLT32DBL - || r_type == R_390_PLT64) - && htab->splt != NULL - && h->plt.offset != (bfd_vma) -1) - || ((r_type == R_390_GOT12 - || r_type == R_390_GOT16 - || r_type == R_390_GOT32 - || r_type == R_390_GOT64 - || r_type == R_390_GOTENT) - && elf_hash_table (info)->dynamic_sections_created - && (! info->shared - || (! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) - || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - && (r_type == R_390_8 - || r_type == R_390_16 - || r_type == R_390_32 - || r_type == R_390_64 - || r_type == R_390_PC16 - || r_type == R_390_PC16DBL - || r_type == R_390_PC32 - || r_type == R_390_PC32DBL - || r_type == R_390_PC64) - && ((input_section->flags & SEC_ALLOC) != 0 - /* DWARF will emit R_390_32 relocations in its - sections against symbols defined externally - in shared libraries. We can't do anything - with them here. */ - || ((input_section->flags & SEC_DEBUGGING) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))) - { - /* In these cases, we don't need the relocation - value. We check specially because in some - obscure cases sec->output_section will be NULL. */ - relocation = 0; - } - else if (sec->output_section == NULL) + if (sec->output_section == NULL) { /* Set a flag that will be cleared later if we find a relocation value for this symbol. output_section @@ -1973,7 +1928,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, { relocate = false; outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); - outrel.r_addend = relocation + rel->r_addend; + outrel.r_addend = rel->r_addend; } else { |