diff options
author | ajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-11 18:08:43 +0000 |
---|---|---|
committer | ajfish <ajfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-08-11 18:08:43 +0000 |
commit | 396974d645ad71a8e465491298b252df5cae3c38 (patch) | |
tree | ca3f0b51722e92514f8533454057cfbce72f1013 | |
parent | 317f832ef8bcf89c59e2e6cc9484989649022477 (diff) | |
download | edk2-396974d645ad71a8e465491298b252df5cae3c38.zip edk2-396974d645ad71a8e465491298b252df5cae3c38.tar.gz edk2-396974d645ad71a8e465491298b252df5cae3c38.tar.bz2 |
Fixed issue with new MAP file feature a fprintf was using a pointer to the .PDB file that was in data that had been freed. Moved the fprint before the free and also print out if the image is PE32 or TE now in the map file.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1241 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r-- | Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c index cc07fa0..fac6ebe 100644 --- a/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c +++ b/Tools/Source/TianoTools/PeiRebase/PeiRebaseExe.c @@ -706,6 +706,18 @@ Returns: memcpy (CurrentPe32Section.Pe32Section + 1, (VOID *) MemoryImagePointerAligned, (UINT32) ImageSize);
+ //
+ // If a map file was selected output mapping information for any file that
+ // was rebased.
+ //
+ if (MapFile != NULL) {
+ fprintf (MapFile, "PE32 File: %s Base:%08lx", FileGuidString, BaseAddress);
+ if (ImageContext.PdbPointer != NULL) {
+ fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
+ }
+ fprintf (MapFile, "\n");
+ }
+
free ((VOID *) MemoryImagePointer);
//
@@ -929,6 +941,19 @@ Returns: GetLength (CurrentPe32Section.Pe32Section->CommonHeader.Size) - sizeof (EFI_PE32_SECTION) -
sizeof (EFI_TE_IMAGE_HEADER)
);
+
+ //
+ // If a map file was selected output mapping information for any file that
+ // was rebased.
+ //
+ if (MapFile != NULL) {
+ fprintf (MapFile, "TE File: %s Base:%08lx", FileGuidString, BaseAddress);
+ if (ImageContext.PdbPointer != NULL) {
+ fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
+ }
+ fprintf (MapFile, "\n");
+ }
+
free ((VOID *) MemoryImagePointer);
free (TEBuffer);
if (FfsFile->Attributes & FFS_ATTRIB_TAIL_PRESENT) {
@@ -972,18 +997,6 @@ Returns: return EFI_NOT_FOUND;
}
}
-
- //
- // If a map file was selected output mapping information for any file that
- // was rebased.
- //
- if (MapFile != NULL) {
- fprintf (MapFile, "File: %s Base:%08lx", FileGuidString, BaseAddress);
- if (ImageContext.PdbPointer != NULL) {
- fprintf (MapFile, " FileName: %s", ImageContext.PdbPointer);
- }
- fprintf (MapFile, "\n");
- }
return EFI_SUCCESS;
}
|