Fix relocs

This commit is contained in:
Paul Mathieu 2021-02-22 20:35:09 -08:00
parent edf167ff2b
commit 44a3a03147

View File

@ -52,7 +52,7 @@ def do_relocs(secmap, relocs):
target_addr = namemap[reloc.target][0] target_addr = namemap[reloc.target][0]
reg = buff[reloc.offset] & 0xf reg = buff[reloc.offset] & 0xf
buff[reloc.offset+0:reloc.offset+4] = [ buff[reloc.offset+0:reloc.offset+4] = [
0xf0 | reg, (target_addr >> 0) & 0xff, 0xe0 | reg, (target_addr >> 0) & 0xff,
0x90 | reg, (target_addr >> 8) & 0xff, 0x90 | reg, (target_addr >> 8) & 0xff,
] ]
sec.text = bytes(buff) sec.text = bytes(buff)