diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-12 04:54:20 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-01-12 04:54:20 +0000 |
commit | f92b6f195ca1977fde10deb5c33ac2fd11dbd2a1 (patch) | |
tree | 659bc84c3e0500db94bba3e22d61c52e7fadddae /MdePkg/Library/BasePeCoffLib | |
parent | 69a99cc635e018f268996d6115fa2051da7acdab (diff) | |
download | edk2-platforms-f92b6f195ca1977fde10deb5c33ac2fd11dbd2a1.tar.xz |
Correctly skip debug entry.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2232 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePeCoffLib')
-rw-r--r-- | MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c index 0ddbc7a672..ad9c627727 100644 --- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c +++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c @@ -391,7 +391,7 @@ PeCoffLoaderGetImageInfo ( }
if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index++) {
+ for (Index = 0; Index < DebugDirectoryEntry->Size; Index += Size) {
//
// Read next debug directory entry
//
@@ -406,9 +406,8 @@ PeCoffLoaderGetImageInfo ( ImageContext->ImageError = IMAGE_ERROR_IMAGE_READ;
return Status;
}
-
if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
+ ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
if (DebugEntry.RVA == 0 && DebugEntry.FileOffset != 0) {
ImageContext->ImageSize += DebugEntry.SizeOfData;
}
@@ -480,7 +479,7 @@ PeCoffLoaderGetImageInfo ( }
if (DebugDirectoryEntryFileOffset != 0) {
- for (Index = 0; Index < DebugDirectoryEntry->Size; Index++) {
+ for (Index = 0; Index < DebugDirectoryEntry->Size; Index += Size) {
//
// Read next debug directory entry
//
@@ -497,7 +496,7 @@ PeCoffLoaderGetImageInfo ( }
if (DebugEntry.Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
- ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index * sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY));
+ ImageContext->DebugDirectoryEntryRva = (UINT32) (DebugDirectoryEntryRva + Index);
return RETURN_SUCCESS;
}
}
|