From: uz Date: Thu, 4 Aug 2011 13:20:45 +0000 (+0000) Subject: Read Sections before Scopes, because the later will reference the former. X-Git-Tag: V2.13.3~346 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=871873b1ac655f35ff6f6f072b70b08feeb0e782;p=cc65 Read Sections before Scopes, because the later will reference the former. git-svn-id: svn://svn.cc65.org/cc65/trunk@5116 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ld65/library.c b/src/ld65/library.c index 9047f3e83..e9ac7b93b 100644 --- a/src/ld65/library.c +++ b/src/ld65/library.c @@ -381,15 +381,17 @@ static void LibResolve (void) /* Read the assertions from the object file */ ObjReadAssertions (L->F, O->Start + O->Header.AssertOffs, O); - /* Read the scope table from the object file */ - ObjReadScopes (L->F, O->Start + O->Header.ScopeOffs, O); - /* Seek to the start of the segment list and read the segments. - * This must be last, since the data here may reference other + * This must be late, since the data here may reference other * stuff. */ ObjReadSections (L->F, O->Start + O->Header.SegOffs, O); + /* Read the scope table from the object file. Scopes reference + * segments, so we must read them after the sections. + */ + ObjReadScopes (L->F, O->Start + O->Header.ScopeOffs, O); + /* All references to strings are now resolved, so we can delete * the module string pool. */