From: uz Date: Thu, 27 Jan 2011 16:20:14 +0000 (+0000) Subject: Must read line infos earlier when reading in an object files, because later X-Git-Tag: V2.13.3~533 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d7d1ad7fd0dcde5963ec0aaad95f89f0638907ea;p=cc65 Must read line infos earlier when reading in an object files, because later data references it. git-svn-id: svn://svn.cc65.org/cc65/trunk@4927 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ld65/objfile.c b/src/ld65/objfile.c index a38497cb7..a81927704 100644 --- a/src/ld65/objfile.c +++ b/src/ld65/objfile.c @@ -132,7 +132,7 @@ void ObjReadFiles (FILE* F, unsigned long Pos, ObjData* O) void ObjReadSections (FILE* F, unsigned long Pos, ObjData* O) /* Read the section data from a file at the given position */ { - unsigned I; + unsigned I; unsigned SectionCount; /* Seek to the correct position */ @@ -151,7 +151,7 @@ void ObjReadSections (FILE* F, unsigned long Pos, ObjData* O) void ObjReadImports (FILE* F, unsigned long Pos, ObjData* O) /* Read the imports from a file at the given position */ { - unsigned I; + unsigned I; unsigned ImportCount; /* Seek to the correct position */ @@ -170,7 +170,7 @@ void ObjReadImports (FILE* F, unsigned long Pos, ObjData* O) void ObjReadExports (FILE* F, unsigned long Pos, ObjData* O) /* Read the exports from a file at the given position */ { - unsigned I; + unsigned I; unsigned ExportCount; /* Seek to the correct position */ @@ -245,7 +245,7 @@ void ObjReadStrPool (FILE* F, unsigned long Pos, ObjData* O) void ObjReadAssertions (FILE* F, unsigned long Pos, ObjData* O) /* Read the assertions from a file at the given offset */ { - unsigned I; + unsigned I; unsigned AssertionCount; /* Seek to the correct position */ @@ -264,7 +264,7 @@ void ObjReadAssertions (FILE* F, unsigned long Pos, ObjData* O) void ObjReadScopes (FILE* F, unsigned long Pos, ObjData* O) /* Read the scope table from a file at the given offset */ { - unsigned I; + unsigned I; unsigned ScopeCount; /* Seek to the correct position */ @@ -301,6 +301,9 @@ void ObjAdd (FILE* Obj, const char* Name) /* Read the files list from the object file */ ObjReadFiles (Obj, O->Header.FileOffs, O); + /* Read the line infos from the object file */ + ObjReadLineInfos (Obj, O->Header.LineInfoOffs, O); + /* Read the imports list from the object file */ ObjReadImports (Obj, O->Header.ImportOffs, O); @@ -310,9 +313,6 @@ void ObjAdd (FILE* Obj, const char* Name) /* Read the object debug symbols from the object file */ ObjReadDbgSyms (Obj, O->Header.DbgSymOffs, O); - /* Read the line infos from the object file */ - ObjReadLineInfos (Obj, O->Header.LineInfoOffs, O); - /* Read the assertions from the object file */ ObjReadAssertions (Obj, O->Header.AssertOffs, O);