+ Error ("Object file `%s' has wrong version, expected %08X, got %08X",
+ Name, OBJ_VERSION, H->Version);
+ }
+ H->Flags = Read16 (Obj);
+ H->OptionOffs = Read32 (Obj);
+ H->OptionSize = Read32 (Obj);
+ H->FileOffs = Read32 (Obj);
+ H->FileSize = Read32 (Obj);
+ H->SegOffs = Read32 (Obj);
+ H->SegSize = Read32 (Obj);
+ H->ImportOffs = Read32 (Obj);
+ H->ImportSize = Read32 (Obj);
+ H->ExportOffs = Read32 (Obj);
+ H->ExportSize = Read32 (Obj);
+ H->DbgSymOffs = Read32 (Obj);
+ H->DbgSymSize = Read32 (Obj);
+ H->LineInfoOffs = Read32 (Obj);
+ H->LineInfoSize = Read32 (Obj);
+ H->StrPoolOffs = Read32 (Obj);
+ H->StrPoolSize = Read32 (Obj);
+ H->AssertOffs = Read32 (Obj);
+ H->AssertSize = Read32 (Obj);
+ H->ScopeOffs = Read32 (Obj);
+ H->ScopeSize = Read32 (Obj);
+ H->SpanOffs = Read32 (Obj);
+ H->SpanSize = Read32 (Obj);
+}
+
+
+
+void ObjReadFiles (FILE* F, unsigned long Pos, ObjData* O)
+/* Read the files list from a file at the given position */
+{
+ unsigned I;
+ unsigned FileCount;
+
+ /* Seek to the correct position */
+ FileSetPos (F, Pos);
+
+ /* Read the data */
+ FileCount = ReadVar (F);
+ CollGrow (&O->Files, FileCount);
+ for (I = 0; I < FileCount; ++I) {
+ CollAppend (&O->Files, ReadFileInfo (F, O));
+ }
+}
+
+
+
+void ObjReadSections (FILE* F, unsigned long Pos, ObjData* O)
+/* Read the section data from a file at the given position */
+{
+ unsigned I;
+ unsigned SectionCount;
+
+ /* Seek to the correct position */
+ FileSetPos (F, Pos);
+
+ /* Read the data */
+ SectionCount = ReadVar (F);
+ CollGrow (&O->Sections, SectionCount);
+ for (I = 0; I < SectionCount; ++I) {
+ CollAppend (&O->Sections, ReadSection (F, O));
+ }
+}
+
+
+
+void ObjReadImports (FILE* F, unsigned long Pos, ObjData* O)
+/* Read the imports from a file at the given position */
+{
+ unsigned I;
+ unsigned ImportCount;
+
+ /* Seek to the correct position */
+ FileSetPos (F, Pos);
+
+ /* Read the data */
+ ImportCount = ReadVar (F);
+ CollGrow (&O->Imports, ImportCount);
+ for (I = 0; I < ImportCount; ++I) {
+ CollAppend (&O->Imports, ReadImport (F, O));
+ }
+}
+
+
+
+void ObjReadExports (FILE* F, unsigned long Pos, ObjData* O)
+/* Read the exports from a file at the given position */
+{
+ unsigned I;
+ unsigned ExportCount;
+
+ /* Seek to the correct position */
+ FileSetPos (F, Pos);
+
+ /* Read the data */
+ ExportCount = ReadVar (F);
+ CollGrow (&O->Exports, ExportCount);
+ for (I = 0; I < ExportCount; ++I) {
+ CollAppend (&O->Exports, ReadExport (F, O));