mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
clang-format files.
This commit is contained in:
parent
9248f02557
commit
16bb7ab841
|
@ -594,9 +594,8 @@ void ElfLinkerAMD64::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||
|
||||
void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||
const char *type) {
|
||||
if (!strcmp(type, "R_ARM_PC24")
|
||||
|| !strcmp(type, "R_ARM_CALL")
|
||||
|| !strcmp(type, "R_ARM_JUMP24")) {
|
||||
if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
|
||||
!strcmp(type, "R_ARM_JUMP24")) {
|
||||
value -= rel->section->offset + rel->offset;
|
||||
set_be24(1 + location, get_be24(1 + location) + value / 4);
|
||||
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
||||
|
@ -620,9 +619,8 @@ void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, upx_ui
|
|||
|
||||
void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, upx_uint64_t value,
|
||||
const char *type) {
|
||||
if (!strcmp(type, "R_ARM_PC24")
|
||||
|| !strcmp(type, "R_ARM_CALL")
|
||||
|| !strcmp(type, "R_ARM_JUMP24")) {
|
||||
if (!strcmp(type, "R_ARM_PC24") || !strcmp(type, "R_ARM_CALL") ||
|
||||
!strcmp(type, "R_ARM_JUMP24")) {
|
||||
value -= rel->section->offset + rel->offset;
|
||||
set_le24(location, get_le24(location) + value / 4);
|
||||
} else if (strcmp(type, "R_ARM_ABS32") == 0) {
|
||||
|
@ -664,9 +662,8 @@ void ElfLinkerArm64LE::relocate1(const Relocation *rel, upx_byte *location, upx_
|
|||
value -= rel->section->offset + rel->offset;
|
||||
upx_uint32_t const m19 = ~(~0u << 19);
|
||||
upx_uint32_t w = get_le32(location);
|
||||
set_le32(location,
|
||||
(w & ~((3u << 29) | ( m19 << 5)))
|
||||
| ((3u & value) << 29) | ((m19 & (value >> 2)) << 5));
|
||||
set_le32(location, (w & ~((3u << 29) | (m19 << 5))) | ((3u & value) << 29) |
|
||||
((m19 & (value >> 2)) << 5));
|
||||
} else if (!strcmp(type, "ABS32")) {
|
||||
set_le32(location, get_le32(location) + value);
|
||||
} else if (!strcmp(type, "ABS64")) {
|
||||
|
|
|
@ -115,8 +115,7 @@ unsigned ptr_udiff(const void *p1, const void *p2) {
|
|||
return ACC_ICONV(unsigned, d);
|
||||
}
|
||||
|
||||
void mem_clear(void *p, size_t n)
|
||||
{
|
||||
void mem_clear(void *p, size_t n) {
|
||||
mem_size_assert(1, n);
|
||||
memset(p, 0, n);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user