all: clang-format
This commit is contained in:
+6
-12
@@ -840,21 +840,18 @@ void ElfLinkerPpc64le::relocate1(const Relocation *rel, byte *location, upx_uint
|
|||||||
internal_error("unaligned word displacement");
|
internal_error("unaligned word displacement");
|
||||||
// FIXME: displacement overflow?
|
// FIXME: displacement overflow?
|
||||||
set_le32(location, (0xffff0003 & get_le32(location)) + (0x0000fffc & value));
|
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)
|
if (3 & value)
|
||||||
internal_error("unaligned word displacement");
|
internal_error("unaligned word displacement");
|
||||||
// FIXME: displacement overflow?
|
// FIXME: displacement overflow?
|
||||||
set_le32(location, (0xfc000003 & get_le32(location)) + (0x03fffffc & value));
|
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;
|
int displ = (signed char) *location + (int) value;
|
||||||
if (range_check && (displ < -128 || displ > 127))
|
if (range_check && (displ < -128 || displ > 127))
|
||||||
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
||||||
rel->offset);
|
rel->offset);
|
||||||
*location += value;
|
*location += value;
|
||||||
}
|
} else if (strcmp(type, "16") == 0)
|
||||||
else if (strcmp(type, "16") == 0)
|
|
||||||
set_le16(location, get_le16(location) + value);
|
set_le16(location, get_le16(location) + value);
|
||||||
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
||||||
set_le32(location, get_le32(location) + value);
|
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");
|
internal_error("unaligned word displacement");
|
||||||
// FIXME: displacement overflow?
|
// FIXME: displacement overflow?
|
||||||
set_be32(location, (0xffff0003 & get_be32(location)) + (0x0000fffc & value));
|
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)
|
if (3 & value)
|
||||||
internal_error("unaligned word displacement");
|
internal_error("unaligned word displacement");
|
||||||
// FIXME: displacement overflow?
|
// FIXME: displacement overflow?
|
||||||
set_be32(location, (0xfc000003 & get_be32(location)) + (0x03fffffc & value));
|
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;
|
int displ = (signed char) *location + (int) value;
|
||||||
if (range_check && (displ < -128 || displ > 127))
|
if (range_check && (displ < -128 || displ > 127))
|
||||||
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
internal_error("target out of range (%d) in reloc %s:%x\n", displ, rel->section->name,
|
||||||
rel->offset);
|
rel->offset);
|
||||||
*location += value;
|
*location += value;
|
||||||
}
|
} else if (strcmp(type, "16") == 0)
|
||||||
else if (strcmp(type, "16") == 0)
|
|
||||||
set_be16(location, get_be16(location) + value);
|
set_be16(location, get_be16(location) + value);
|
||||||
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
else if (strncmp(type, "32", 2) == 0) // for "32" and "32S"
|
||||||
set_be32(location, get_be32(location) + value);
|
set_be32(location, get_be32(location) + value);
|
||||||
|
|||||||
Reference in New Issue
Block a user