[PATCH 13/15] s390: Sync relocation order between {elf32|elf64}-s390.c
Jens Remus
jremus@linux.ibm.com
Fri Nov 7 16:34:56 GMT 2025
More information about the Binutils mailing list
Fri Nov 7 16:34:56 GMT 2025
- Previous message (by thread): [PATCH 12/15] s390: Sync relocation error message between {elf32|elf64}-s390.c
- Next message (by thread): [PATCH 14/15] s390: Use elf_append_rela helper
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Over time elf32-s390.c and elf64-s390.c have diverged in some areas. Align order of relocations in conditions by using a consistent sort order. This simplifies comparison of elf32-s390.c and elf64-s390.c, as it reduces the number of unimportant differences. Non-functional change. bfd/ * elf32-s390.c: Sync order of relocations in conditions. * elf64-s390.c: Likewise. Signed-off-by: Jens Remus <jremus@linux.ibm.com> --- bfd/elf32-s390.c | 22 +++++++++++----------- bfd/elf64-s390.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 87bc544f8306..8ad7ca5a729a 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -1047,11 +1047,11 @@ elf_s390_check_relocs (bfd *abfd, break; /* Fall through. */ + case R_390_PLT32: case R_390_PLT12DBL: case R_390_PLT16DBL: case R_390_PLT24DBL: case R_390_PLT32DBL: - case R_390_PLT32: case R_390_PLTOFF16: case R_390_PLTOFF32: /* This symbol requires a procedure linkage table entry. We @@ -1191,11 +1191,11 @@ elf_s390_check_relocs (bfd *abfd, case R_390_16: case R_390_32: case R_390_PC16: + case R_390_PC32: case R_390_PC12DBL: case R_390_PC16DBL: case R_390_PC24DBL: case R_390_PC32DBL: - case R_390_PC32: if (h != NULL && bfd_link_executable (info)) { /* If this reloc is in a read-only section, we might @@ -1238,11 +1238,11 @@ elf_s390_check_relocs (bfd *abfd, if ((bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0 && ((ELF32_R_TYPE (rel->r_info) != R_390_PC16 + && ELF32_R_TYPE (rel->r_info) != R_390_PC32 && ELF32_R_TYPE (rel->r_info) != R_390_PC12DBL && ELF32_R_TYPE (rel->r_info) != R_390_PC16DBL && ELF32_R_TYPE (rel->r_info) != R_390_PC24DBL - && ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL - && ELF32_R_TYPE (rel->r_info) != R_390_PC32) + && ELF32_R_TYPE (rel->r_info) != R_390_PC32DBL) || (h != NULL && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak @@ -1317,11 +1317,11 @@ elf_s390_check_relocs (bfd *abfd, p->count += 1; if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 + || ELF32_R_TYPE (rel->r_info) == R_390_PC32 || ELF32_R_TYPE (rel->r_info) == R_390_PC12DBL || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL || ELF32_R_TYPE (rel->r_info) == R_390_PC24DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) + || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL) p->pc_count += 1; } break; @@ -2410,11 +2410,11 @@ elf_s390_relocate_section (bfd *output_bfd, unresolved_reloc = false; break; + case R_390_PLT32: case R_390_PLT12DBL: case R_390_PLT16DBL: case R_390_PLT24DBL: case R_390_PLT32DBL: - case R_390_PLT32: /* Relocation is to the entry for this symbol in the procedure linkage table. */ @@ -2472,11 +2472,11 @@ elf_s390_relocate_section (bfd *output_bfd, break; case R_390_PC16: + case R_390_PC32: case R_390_PC12DBL: case R_390_PC16DBL: case R_390_PC24DBL: case R_390_PC32DBL: - case R_390_PC32: if (h != NULL && s390_is_ifunc_symbol_p (h) && h->def_regular @@ -2571,11 +2571,11 @@ elf_s390_relocate_section (bfd *output_bfd, && !resolved_to_zero) || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 + && r_type != R_390_PC32 && r_type != R_390_PC12DBL && r_type != R_390_PC16DBL && r_type != R_390_PC24DBL - && r_type != R_390_PC32DBL - && r_type != R_390_PC32) + && r_type != R_390_PC32DBL) || !SYMBOL_CALLS_LOCAL (info, h))) || (ELIMINATE_COPY_RELOCS && !bfd_link_pic (info) @@ -2613,11 +2613,11 @@ elf_s390_relocate_section (bfd *output_bfd, else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 + || r_type == R_390_PC32 || r_type == R_390_PC12DBL || r_type == R_390_PC16DBL || r_type == R_390_PC24DBL || r_type == R_390_PC32DBL - || r_type == R_390_PC32 || !bfd_link_pic (info) || !SYMBOLIC_BIND (info, h) || !h->def_regular)) diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 8f68cd0a38e4..da661206c641 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -1049,12 +1049,12 @@ elf_s390_check_relocs (bfd *abfd, break; /* Fall through. */ + case R_390_PLT32: + case R_390_PLT64: case R_390_PLT12DBL: case R_390_PLT16DBL: case R_390_PLT24DBL: - case R_390_PLT32: case R_390_PLT32DBL: - case R_390_PLT64: case R_390_PLTOFF16: case R_390_PLTOFF32: case R_390_PLTOFF64: @@ -1197,13 +1197,13 @@ elf_s390_check_relocs (bfd *abfd, case R_390_16: case R_390_32: case R_390_64: - case R_390_PC12DBL: case R_390_PC16: + case R_390_PC32: + case R_390_PC64: + case R_390_PC12DBL: case R_390_PC16DBL: case R_390_PC24DBL: - case R_390_PC32: case R_390_PC32DBL: - case R_390_PC64: if (h != NULL && bfd_link_executable (info)) { /* If this reloc is in a read-only section, we might @@ -1246,12 +1246,12 @@ elf_s390_check_relocs (bfd *abfd, if ((bfd_link_pic (info) && (sec->flags & SEC_ALLOC) != 0 && ((ELF64_R_TYPE (rel->r_info) != R_390_PC16 + && ELF64_R_TYPE (rel->r_info) != R_390_PC32 + && ELF64_R_TYPE (rel->r_info) != R_390_PC64 && ELF64_R_TYPE (rel->r_info) != R_390_PC12DBL && ELF64_R_TYPE (rel->r_info) != R_390_PC16DBL && ELF64_R_TYPE (rel->r_info) != R_390_PC24DBL - && ELF64_R_TYPE (rel->r_info) != R_390_PC32 - && ELF64_R_TYPE (rel->r_info) != R_390_PC32DBL - && ELF64_R_TYPE (rel->r_info) != R_390_PC64) + && ELF64_R_TYPE (rel->r_info) != R_390_PC32DBL) || (h != NULL && (! SYMBOLIC_BIND (info, h) || h->root.type == bfd_link_hash_defweak @@ -1326,12 +1326,12 @@ elf_s390_check_relocs (bfd *abfd, p->count += 1; if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 + || ELF64_R_TYPE (rel->r_info) == R_390_PC32 + || ELF64_R_TYPE (rel->r_info) == R_390_PC64 || ELF64_R_TYPE (rel->r_info) == R_390_PC12DBL || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL || ELF64_R_TYPE (rel->r_info) == R_390_PC24DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32 - || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC64) + || ELF64_R_TYPE (rel->r_info) == R_390_PC32DBL) p->pc_count += 1; } break; @@ -2651,12 +2651,12 @@ elf_s390_relocate_section (bfd *output_bfd, unresolved_reloc = false; break; + case R_390_PLT32: + case R_390_PLT64: case R_390_PLT12DBL: case R_390_PLT16DBL: case R_390_PLT24DBL: - case R_390_PLT32: case R_390_PLT32DBL: - case R_390_PLT64: /* Relocation is to the entry for this symbol in the procedure linkage table. */ @@ -2757,12 +2757,12 @@ elf_s390_relocate_section (bfd *output_bfd, break; case R_390_PC16: + case R_390_PC32: + case R_390_PC64: case R_390_PC12DBL: case R_390_PC16DBL: case R_390_PC24DBL: - case R_390_PC32: case R_390_PC32DBL: - case R_390_PC64: if (h != NULL && bfd_link_pie (info) && !h->def_regular) @@ -2927,12 +2927,12 @@ elf_s390_relocate_section (bfd *output_bfd, && !resolved_to_zero) || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 + && r_type != R_390_PC32 + && r_type != R_390_PC64 && r_type != R_390_PC12DBL && r_type != R_390_PC16DBL && r_type != R_390_PC24DBL - && r_type != R_390_PC32 - && r_type != R_390_PC32DBL - && r_type != R_390_PC64) + && r_type != R_390_PC32DBL) || !SYMBOL_CALLS_LOCAL (info, h))) || (ELIMINATE_COPY_RELOCS && !bfd_link_pic (info) @@ -2970,12 +2970,12 @@ elf_s390_relocate_section (bfd *output_bfd, else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 + || r_type == R_390_PC32 + || r_type == R_390_PC64 || r_type == R_390_PC12DBL || r_type == R_390_PC16DBL || r_type == R_390_PC24DBL - || r_type == R_390_PC32 || r_type == R_390_PC32DBL - || r_type == R_390_PC64 || !(bfd_link_executable (info) || SYMBOLIC_BIND (info, h)) || !h->def_regular)) { -- 2.48.1
- Previous message (by thread): [PATCH 12/15] s390: Sync relocation error message between {elf32|elf64}-s390.c
- Next message (by thread): [PATCH 14/15] s390: Use elf_append_rela helper
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list