From 76b0b7b1ae6f9c3a56ac6e38150371edac5b6702 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 14 Feb 2024 21:29:51 +0100 Subject: [PATCH] all: clang-format --- src/linker.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index 2cb86e78..7775569e 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -840,21 +840,18 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, byte *location, upx_uint internal_error("unaligned word displacement"); // FIXME: displacement overflow? set_le32(location, (0xffff0003 & get_le32(location)) + (0x0000fffc & value)); - } - else if (strncmp(type, "24", 2) == 0) { // for "24" and "24S" + } else if (strncmp(type, "24", 2) == 0) { // for "24" and "24S" if (3 & value) internal_error("unaligned word displacement"); // FIXME: displacement overflow? set_le32(location, (0xfc000003 & get_le32(location)) + (0x03fffffc & value)); - } - else if (strcmp(type, "8") == 0) { + } else if (strcmp(type, "8") == 0) { int displ = (signed char) *location + (int) value; if (range_check && (displ < -128 || displ > 127)) internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name, rel->offset); *location += value; - } - else if (strcmp(type, "16") == 0) + } else if (strcmp(type, "16") == 0) set_le16(location, get_le16(location) + value); else if (strncmp(type, "32", 2) == 0) // for "32" and "32S" set_le32(location, get_le32(location) + value); @@ -893,21 +890,18 @@ void ElfLinkerPpc64::relocate1(const Relocation *rel, byte *location, upx_uint64 internal_error("unaligned word displacement"); // FIXME: displacement overflow? set_be32(location, (0xffff0003 & get_be32(location)) + (0x0000fffc & value)); - } - else if (strncmp(type, "24", 2) == 0) { // for "24" and "24S" + } else if (strncmp(type, "24", 2) == 0) { // for "24" and "24S" if (3 & value) internal_error("unaligned word displacement"); // FIXME: displacement overflow? set_be32(location, (0xfc000003 & get_be32(location)) + (0x03fffffc & value)); - } - else if (strcmp(type, "8") == 0) { + } else if (strcmp(type, "8") == 0) { int displ = (signed char) *location + (int) value; if (range_check && (displ < -128 || displ > 127)) internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name, rel->offset); *location += value; - } - else if (strcmp(type, "16") == 0) + } else if (strcmp(type, "16") == 0) set_be16(location, get_be16(location) + value); else if (strncmp(type, "32", 2) == 0) // for "32" and "32S" set_be32(location, get_be32(location) + value);