Only byteswap the little endian version of mips64 r_raw_info (#297)
authorAudrey Dutcher <audrey@rhelmot.io>
Sat, 14 Mar 2020 12:28:12 +0000 (05:28 -0700)
committerGitHub <noreply@github.com>
Sat, 14 Mar 2020 12:28:12 +0000 (05:28 -0700)
elftools/elf/structs.py

index 6fc05da4bcb767c8a650a84ae56397e6b4152fc2..2fb56a7a0caf7cc1648d2b28741d27183a1120e2 100644 (file)
@@ -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)