From: Alan Modra Date: Tue, 16 Dec 2025 08:43:15 +0000 (+1030) Subject: Re: LoongArch: Add linker relaxation support for R_LARCH_CALL30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71f40938da488e0b4ed370296f7cce173c27ac97;p=thirdparty%2Fbinutils-gdb.git Re: LoongArch: Add linker relaxation support for R_LARCH_CALL30 clang catches this error and another like it on line 6320. elfnn-loongarch.c:6357:35: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] 6357 | && (r_type != R_LARCH_CALL36 || r_type != R_LARCH_CALL30)) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ * elfnn-loongarch.c (loongarch_elf_relax_section): Correct tests for R_LARCH_CALL36 and_LARCH_CALL30. --- diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index f7dcb8453b2..82f6390505b 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -6317,7 +6317,7 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec, + r_symndx; if ((ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC - && (r_type != R_LARCH_CALL36 || r_type != R_LARCH_CALL30)) + && (r_type != R_LARCH_CALL36 && r_type != R_LARCH_CALL30)) || sym->st_shndx == SHN_ABS) continue; @@ -6354,7 +6354,7 @@ loongarch_elf_relax_section (bfd *abfd, asection *sec, is not set yet. */ if (h != NULL && ((h->type == STT_GNU_IFUNC - && (r_type != R_LARCH_CALL36 || r_type != R_LARCH_CALL30)) + && (r_type != R_LARCH_CALL36 && r_type != R_LARCH_CALL30)) || bfd_is_abs_section (h->root.u.def.section) || h->start_stop)) continue;