Open ecm-pushbx opened 2 years ago
It appears that the map file can be used to find the offset. The map file can be generated by passing -Xlinker -Map=output.map
to gcc. Buried in there we get:
.text 0x0000000000000241 0x14 /tmp/ccY2O2dO.o
0x0000000000000241 main
I'm unsure how to distinguish the tmp object from all other parts that are listed in the map file, however.
@ecm-pushbx : maybe try generate the .o
files as intermediate outputs, rather than going straight from .c
to .exe
. Thank you!
As shown in my feature request I would like to trace assembly listing files created by gcc-ia16 using my debugger and trace listing viewer. Unlike simple DOS executables written in NASM assembly, the object-local zero offset does not correspond to a well-known offset (0100h) in the final executable's CS. Unlike, also, more complex DOS executables, the offset is apparently not one of a limited set of other possibilities either (0000h, 7C00h). This is what the listing file shows:
This instruction ended up at offset 0241h in the final file. How can I determine this number automatically so I can feed it to traclist?