public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Subject: Commit: Fix compile time warning in elfnn-loongarch.c
Date: Tue, 26 Jul 2022 11:33:46 +0100	[thread overview]
Message-ID: <87k080duyd.fsf@redhat.com> (raw)

Hi Guys,

  I am checking in the patch below to fix a compile time warning from
  Clang:
  
  elfnn-loongarch.c:3092:6: error: misleading indentation; statement is not part of the previous 'else' [-Werror,-Wmisleading-indentation]

Cheers
  Nick

bfd/ChangeLog
2022-07-26  Nick Clifton  <nickc@redhat.com>

	* elfnn-loongarch.c (loongarch_elf_relocate_section): Fix
	indentation.

diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index 4efe3d9370c..99d889ae11d 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -3089,19 +3089,17 @@ loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          else
            relocation += rel->r_addend;
 
+         relocation &= 0xfff;
+         /* Signed extend.  */
+         relocation = (relocation ^ 0x800) - 0x800;
+
+         /* For 2G jump, generate pcalau12i, jirl.  */
+         /* If use jirl, turns to R_LARCH_B16.  */
+         uint32_t insn = bfd_get (32, input_bfd, contents + rel->r_offset);
+         if ((insn & 0x4c000000) == 0x4c000000)
            {
-             relocation &= 0xfff;
-             /* Signed extend.  */
-             relocation = (relocation ^ 0x800) - 0x800;
-
-             /* For 2G jump, generate pcalau12i, jirl.  */
-             /* If use jirl, turns to R_LARCH_B16.  */
-             uint32_t insn = bfd_get (32, input_bfd, contents + rel->r_offset);
-             if ((insn & 0x4c000000) == 0x4c000000)
-               {
-                 rel->r_info = ELFNN_R_INFO (r_symndx, R_LARCH_B16);
-                 howto = loongarch_elf_rtype_to_howto (input_bfd, R_LARCH_B16);
-               }
+             rel->r_info = ELFNN_R_INFO (r_symndx, R_LARCH_B16);
+             howto = loongarch_elf_rtype_to_howto (input_bfd, R_LARCH_B16);
            }
          break;
 


                 reply	other threads:[~2022-07-26 10:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k080duyd.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).