+ def parse_rela(this):
+ return this.read_struct('NNn', ('r_offset', 'r_info', 'r_addend'))
+
+ def parse_rel(this):
+ return this.read_struct('NN', ('r_offset', 'r_info'))
+
+ def fixup_reloc(this, reloc):
+ if not 'r_addend' in reloc:
+ reloc['r_addend'] = 0
+ if this.elf_wordsize == 64:
+ reloc['r_sym'] = reloc['r_info'] >> 32
+ reloc['r_type'] = reloc['r_info'] & 0xffffffff
+ else:
+ reloc['r_sym'] = reloc['r_info'] >> 8
+ reloc['r_type'] = reloc['r_info'] & 0xff
+ return reloc
+