aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2022-07-26 11:33:51 +0100
committerWANG Xuerui <git@xen0n.name>2022-08-07 18:51:21 +0800
commit876fd2a74ef6c6a7d3729e2e2538026a4376bb42 (patch)
treef74fd2f487ebc9bdcc1f798bb51ebc583edafbef
parentLoongArch: Add testcases for new relocate types. (diff)
downloadbinutils-gdb-876fd2a74ef6c6a7d3729e2e2538026a4376bb42.tar.gz
binutils-gdb-876fd2a74ef6c6a7d3729e2e2538026a4376bb42.tar.bz2
binutils-gdb-876fd2a74ef6c6a7d3729e2e2538026a4376bb42.zip
Fix indentation in loongarch code, preventing a compile time warning.
(cherry picked from commit 27121f6740fa2051609b2d781d77c4cd23aa590b)
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfnn-loongarch.c22
2 files changed, 15 insertions, 12 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cbe2a01148d..504a4b3502c 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -12,6 +12,11 @@
* dwarf2.c (read_attribute_value): Handle DW_FORM_rnglistx and
DW_FORM_loclistx.
+2022-07-26 Nick Clifton <nickc@redhat.com>
+
+ * elfnn-loongarch.c (loongarch_elf_relocate_section): Fix
+ indentation.
+
2022-07-08 Nick Clifton <nickc@redhat.com>
* 2.39 branch created.
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;