From 79dd5d5b5453609f3495485dd8c43ad3d650b6c6 Mon Sep 17 00:00:00 2001 From: Audrey Dutcher Date: Sat, 14 Mar 2020 05:28:12 -0700 Subject: [PATCH] Only byteswap the little endian version of mips64 r_raw_info (#297) --- elftools/elf/structs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elftools/elf/structs.py b/elftools/elf/structs.py index 6fc05da..2fb56a7 100644 --- a/elftools/elf/structs.py +++ b/elftools/elf/structs.py @@ -237,6 +237,9 @@ class ELFStructs(object): def compute_r_info(ctx): raw = ctx['r_raw_info'] + if not self.little_endian: + return raw + # little endian requires an additional byteswap return (((raw & 0xffffffff) << 32) | ((raw >> 56) & 0xff) | ((raw >> 40) & 0xff00) -- 2.30.2