blob: 1412ed8dd9e6e853d0b2be01c60aad1c75491e87 [file] [log] [blame]
Andrew Boiee79c9602016-03-10 16:02:24 -08001import sys
2
3# For some baffling reason IAMCU sets the instruction set architecture
4# in the ELF header to 0x06 instead of 0x03 even though it is just
5# 386 code. This gives QEMU fits. Hack it!
6fd = open(sys.argv[1], "r+b")
7fd.seek(0x12)
8# Write 0x03 which is EM_386 to e_machine
9fd.write(b'\x03')
10fd.close()
11