Search code examples
omf

OMF(Object Module Format) length field appears incorrect


I am a little confused, with the PUBDEF record in the OMF object format. My assembler has generated a result which states the record is 4000 bytes, when it clearly is not so why would it do this?

Image of Hex view of OMF

The 0xa0 and 0x0f is the record length in little endian format,

please view the specificaiton: http://pierrelib.pagesperso-orange.fr/exec_formats/OMF_v1.1.pdf

It also appears to state that the strings are zero bytes in length and at one point even has just a zero string length with no string provided. Maybe I am reading the file wrong? I have spent hours now and am struggling.

If anyone can help me with my issue as I am writing a linker and cannot continue without understanding this.

Thanks


Solution

  • There is no PUBDEF record in the file. You seem to have miscalculated the previous record size:

    0000:80 THEADR
    000e:88 CoMENT
    0032:96 LNAMES
    0041:98 SEGDEF
    004B:98 SEGDEF
    0055:88 COMENT
    005C:a0 LEDATA
    006E:a0 LEDATA
    007b:8a MODEND
    

    Learn to use more sofisticated tools for OMF inspection, such as Tdump.exe or ODU.exe.