|
@@ -183,11 +183,13 @@ PROCEDURE ReadObjectFile*(CONST moduleName, path, extension: ARRAY OF CHAR; link
|
|
VAR fileName: Files.FileName; file: Files.File; reader: Files.Reader; i: LONGINT;
|
|
VAR fileName: Files.FileName; file: Files.File; reader: Files.Reader; i: LONGINT;
|
|
offers, requires: ObjectFile.NameList;name: ARRAY 256 OF CHAR; sn: ObjectFile.SegmentedName;
|
|
offers, requires: ObjectFile.NameList;name: ARRAY 256 OF CHAR; sn: ObjectFile.SegmentedName;
|
|
BEGIN
|
|
BEGIN
|
|
- linker.Information (moduleName, "processing");
|
|
|
|
sn := moduleName;
|
|
sn := moduleName;
|
|
IF (moduleList # NIL) & (moduleList.Get(sn) = finished) THEN
|
|
IF (moduleList # NIL) & (moduleList.Get(sn) = finished) THEN
|
|
linker.Warning(moduleName, "duplicate");
|
|
linker.Warning(moduleName, "duplicate");
|
|
RETURN;
|
|
RETURN;
|
|
|
|
+ ELSIF (moduleList # NIL) & (moduleList.Get(sn) = processing) THEN
|
|
|
|
+ linker.Error(moduleName, "cyclic import");
|
|
|
|
+ RETURN;
|
|
END;
|
|
END;
|
|
|
|
|
|
IF path # "" THEN Files.JoinPath (path, moduleName, fileName); ELSE COPY(moduleName,fileName); END;
|
|
IF path # "" THEN Files.JoinPath (path, moduleName, fileName); ELSE COPY(moduleName,fileName); END;
|
|
@@ -204,15 +206,15 @@ BEGIN
|
|
|
|
|
|
GenericLinker.OffersRequires(reader, offers, requires);
|
|
GenericLinker.OffersRequires(reader, offers, requires);
|
|
reader.SetPos(0);
|
|
reader.SetPos(0);
|
|
- IF moduleList # NIL THEN
|
|
|
|
- moduleList.Put(sn,processing);
|
|
|
|
|
|
+ FOR i := 0 TO LEN(offers)-1 DO
|
|
|
|
+ moduleList.Put(offers[i],processing);
|
|
END;
|
|
END;
|
|
|
|
|
|
IF (moduleList # NIL) & (requires # NIL) THEN
|
|
IF (moduleList # NIL) & (requires # NIL) THEN
|
|
FOR i := 0 TO LEN(requires)-1 DO
|
|
FOR i := 0 TO LEN(requires)-1 DO
|
|
IF moduleList.Get(requires[i]) = NIL THEN
|
|
IF moduleList.Get(requires[i]) = NIL THEN
|
|
name := requires[i];
|
|
name := requires[i];
|
|
- TRACE(name);
|
|
|
|
|
|
+ (*linker.Information(name, "auto");*)
|
|
ReadObjectFile(name,path,extension, linker, moduleList);
|
|
ReadObjectFile(name,path,extension, linker, moduleList);
|
|
IF linker.error THEN RETURN END;
|
|
IF linker.error THEN RETURN END;
|
|
ELSIF moduleList.Get(requires[i]) = processing THEN
|
|
ELSIF moduleList.Get(requires[i]) = processing THEN
|
|
@@ -223,9 +225,12 @@ BEGIN
|
|
END;
|
|
END;
|
|
END;
|
|
END;
|
|
END;
|
|
END;
|
|
|
|
+ linker.Information (moduleName, "processing");
|
|
GenericLinker.Process (reader, linker);
|
|
GenericLinker.Process (reader, linker);
|
|
IF moduleList # NIL THEN
|
|
IF moduleList # NIL THEN
|
|
- moduleList.Put(sn,finished);
|
|
|
|
|
|
+ FOR i := 0 TO LEN(offers)-1 DO
|
|
|
|
+ moduleList.Put(offers[i],finished);
|
|
|
|
+ END;
|
|
END;
|
|
END;
|
|
IF reader.res # Files.Ok THEN linker.Error (fileName, "failed to parse"); END;
|
|
IF reader.res # Files.Ok THEN linker.Error (fileName, "failed to parse"); END;
|
|
END ReadObjectFile;
|
|
END ReadObjectFile;
|