瀏覽代碼

Seek back to the end after FlashOS relocation so the dummy signature ends up at the end and not the place of the last relocation in the standalone version.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ld-tigcc@1244 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 16 年之前
父節點
當前提交
56f932f952
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      export/exp_os.c

+ 4 - 2
export/exp_os.c

@@ -1,7 +1,7 @@
 /* exp_os.c: Routines to export to a Flash OS
 
    Copyright (C) 2004 Billy Charvet
-   Copyright (C) 2004 Kevin Kofler
+   Copyright (C) 2004-2008 Kevin Kofler
    Copyright (C) 2004 Sebastian Reichelt
 
    This program is free software; you can redistribute it and/or modify
@@ -55,7 +55,7 @@ BOOLEAN ExportFlashOSFile (const PROGRAM *Program, EXP_FILE *File, SIZE FileSize
 	
 	// Get a pointer to the main section.
 	const char *SectionFileName = NULL;
-	OFFSET DataStart = 0;
+	OFFSET DataStart, DataEnd;
 	I4 ROMBase;
 	const I1 ZeroByte = 0;
 	
@@ -100,6 +100,7 @@ BOOLEAN ExportFlashOSFile (const PROGRAM *Program, EXP_FILE *File, SIZE FileSize
 	// Pad the main section to an even length.
 	if (MainSection->Size & 0x1)
 		ExportWrite (File, &ZeroByte, 1, 1);
+	DataEnd = ExportTell (File);
 	
 	if (!(IsEmpty (MainSection->Relocs)))
 	{
@@ -138,6 +139,7 @@ BOOLEAN ExportFlashOSFile (const PROGRAM *Program, EXP_FILE *File, SIZE FileSize
 				// space in the OS.
 			}
 		}
+		ExportSeek (File, DataEnd);
 	}
 	
 	if ((!(IsEmpty (MainSection->ROMCalls))) && (!(MainSection->ROMCalls.Handled)))