From: Audrey Dutcher Date: Sat, 14 Mar 2020 12:28:12 +0000 (-0700) Subject: Only byteswap the little endian version of mips64 r_raw_info (#297) X-Git-Tag: v0.27~43 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=79dd5d5b5453609f3495485dd8c43ad3d650b6c6;p=pyelftools.git Only byteswap the little endian version of mips64 r_raw_info (#297) --- 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)