File format · .o1
O1 File Format: Free Pascal Object Files for the GO32 v1 Target
An .o1 file is Free Pascal's object output for the GO32 v1 DOS target. Learn what is inside it, why builds fail, and how to fix a damaged file.
An .o1 file is a compiled object file produced by the Free Pascal Compiler (FPC) when it builds software for the GO32 v1 platform. The Free Pascal development team designed it as an intermediate build artifact. The compiler writes machine code and data into the file, and the linker later binds it into a finished executable or library. It is a developer file, not a document. Because the compiler can recreate it from source, the usual fix for a damaged .o1 file is a rebuild, not a repair.
The role of the .o1 file in a Free Pascal build
Free Pascal compiles each Pascal unit into an object file before linking. On the GO32 v1 target, a DOS-era platform built around the first generation of the GO32 DOS extender, those files carry the .o1 extension. The extension distinguishes them from the plain .o object files other targets emit, and the two are not interchangeable.
One file holds the output of one compilation pass: machine code for the target processor, initialized data, and the symbol and relocation records the linker needs to stitch units together. Since the file is a byproduct, deleting it costs nothing as long as the Pascal source survives.
Can you open an .o1 file?
Not in any useful sense. The file is binary from the first byte to the last. It holds no readable text beyond embedded strings and, where the compiler recorded them, symbol names. Nothing outside the FPC toolchain is expected to open it, and a text editor shows noise at best.
The official Free Pascal Compiler documentation is the authority on the exact record layout of the GO32 v1 object format. We leave precise header and record details to that documentation rather than guessing here, because an invented signature or offset helps nobody repairing a file.
Why do .o1 files become corrupt?
The classic cause is an interrupted write. If the compiler crashes, power is lost, or the disk reports a write failure mid-compilation, the object file is left truncated or internally inconsistent. The next build then fails at the link stage.
Storage decay causes the other main class of damage. Bad sectors, failing drives, and dying removable media can make parts of the file unreadable even though the directory listing still shows it. A full disk can also leave a zero-length or partial object file, because the compiler cannot finish writing its output.
Two quieter failures produce the same linker errors later on. Copying object files over unstable networks or faulty USB media can truncate them. Version control that treats binary files as text can mangle them during a merge.
How do you recognize a damaged .o1 file?
The failure usually appears at link time, not compile time. The linker may report an unexpected end of file, an invalid object record, or a plain read error, and the build stops there. A zero-byte file is another giveaway, as is an operating system that refuses to recognize the file at all.
How do you fix a damaged .o1 file?
In most cases no repair is needed, because the compiler rebuilds the file from source. Follow these steps in order; each one protects something the next step depends on.
- Back up your source and project files. The source is the one thing you cannot recreate, and failing hardware or disk repairs put it at risk. Object files need no backup, because regenerating them is faster and safer than restoring them.
- Stabilize a suspect disk. Run a diagnostic such as chkdsk on Windows or fsck on Linux so failing sectors are marked and the damage stops spreading. The tool cannot restore bytes already lost, which is why the backup comes first.
- Free up disk space if the volume was full. A full disk is a common cause of zero-length and partial object files. Without free space, the next build fails the same way.
- Delete the damaged .o1 file. A stale, half-written object file left in the build output can break the next link. Removing it forces a clean regeneration.
- Rebuild the project. The compiler writes a fresh object file from the unit's source. A clean build after clearing stale output resolves most one-off linker errors.
What can you recover when the source is gone?
Occasionally the object file outlives the source. Old machines are retired, backups go missing, and the .o1 file becomes the only surviving artifact of a unit. At that point recovery becomes a data extraction job rather than a rebuild.
Working from a binary copy, our engineers can parse the object structure and salvage intact machine code and data segments. Where the record tables are damaged, we rebuild them so the linker can read the file again. Recovered symbol names, when present, help map the code back to its original units.
No service can restore the Pascal source itself. Identifiers, comments, and high-level structure do not survive compilation. The realistic best outcome is recovered machine code, data, and symbols, which a developer can study and partially rewrite into source.
Hex editing an .o1 file by hand is a poor gamble. One wrong byte in a header or relocation record can turn a partly readable file into an unreadable one. Keep an untouched copy aside before any experiment.
If you are holding a damaged .o1 file that cannot be rebuilt, send it to our team for a free evaluation. We will examine the binary, report what is recoverable, and quote any work before you commit to it.
Send us your .o1 file for a free evaluation
Our recovery engineers will tell you exactly what can be recovered — at no cost. There is no charge if we cannot recover your data.
Start a free evaluation