diff options
-rwxr-xr-x | BaseTools/Bin/Win32/BootSectImage.exe | bin | 393216 -> 393216 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/EfiLdrImage.exe | bin | 421888 -> 421888 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/EfiRom.exe | bin | 446464 -> 446464 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenBootSector.exe | bin | 425984 -> 425984 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenCrc32.exe | bin | 425984 -> 425984 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenFfs.exe | bin | 430080 -> 430080 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenFv.exe | bin | 479232 -> 479232 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenFw.exe | bin | 466944 -> 466944 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenPage.exe | bin | 421888 -> 421888 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenSec.exe | bin | 446464 -> 446464 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/GenVtf.exe | bin | 442368 -> 442368 bytes | |||
-rw-r--r-- | BaseTools/Bin/Win32/LzmaCompress.exe | bin | 397312 -> 397312 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/Split.exe | bin | 425984 -> 425984 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/TianoCompress.exe | bin | 434176 -> 434176 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/VfrCompile.exe | bin | 1146880 -> 1146880 bytes | |||
-rwxr-xr-x | BaseTools/Bin/Win32/VolInfo.exe | bin | 471040 -> 471040 bytes | |||
-rw-r--r-- | BaseTools/Source/C/GenFw/GenFw.c | 32 |
17 files changed, 25 insertions, 7 deletions
diff --git a/BaseTools/Bin/Win32/BootSectImage.exe b/BaseTools/Bin/Win32/BootSectImage.exe Binary files differindex a0cf0fd388..966832de32 100755 --- a/BaseTools/Bin/Win32/BootSectImage.exe +++ b/BaseTools/Bin/Win32/BootSectImage.exe diff --git a/BaseTools/Bin/Win32/EfiLdrImage.exe b/BaseTools/Bin/Win32/EfiLdrImage.exe Binary files differindex 57662bf0a3..89c655d3dc 100755 --- a/BaseTools/Bin/Win32/EfiLdrImage.exe +++ b/BaseTools/Bin/Win32/EfiLdrImage.exe diff --git a/BaseTools/Bin/Win32/EfiRom.exe b/BaseTools/Bin/Win32/EfiRom.exe Binary files differindex 9ca2fb26dc..643162e87b 100755 --- a/BaseTools/Bin/Win32/EfiRom.exe +++ b/BaseTools/Bin/Win32/EfiRom.exe diff --git a/BaseTools/Bin/Win32/GenBootSector.exe b/BaseTools/Bin/Win32/GenBootSector.exe Binary files differindex 08180b4ae4..48a17af7e6 100755 --- a/BaseTools/Bin/Win32/GenBootSector.exe +++ b/BaseTools/Bin/Win32/GenBootSector.exe diff --git a/BaseTools/Bin/Win32/GenCrc32.exe b/BaseTools/Bin/Win32/GenCrc32.exe Binary files differindex 1b9020ec52..01234aff5f 100755 --- a/BaseTools/Bin/Win32/GenCrc32.exe +++ b/BaseTools/Bin/Win32/GenCrc32.exe diff --git a/BaseTools/Bin/Win32/GenFfs.exe b/BaseTools/Bin/Win32/GenFfs.exe Binary files differindex 3ffc0fa7ee..3ee7925217 100755 --- a/BaseTools/Bin/Win32/GenFfs.exe +++ b/BaseTools/Bin/Win32/GenFfs.exe diff --git a/BaseTools/Bin/Win32/GenFv.exe b/BaseTools/Bin/Win32/GenFv.exe Binary files differindex a01bf7edec..6011dd3176 100755 --- a/BaseTools/Bin/Win32/GenFv.exe +++ b/BaseTools/Bin/Win32/GenFv.exe diff --git a/BaseTools/Bin/Win32/GenFw.exe b/BaseTools/Bin/Win32/GenFw.exe Binary files differindex 0b6333a464..f2b04ed369 100755 --- a/BaseTools/Bin/Win32/GenFw.exe +++ b/BaseTools/Bin/Win32/GenFw.exe diff --git a/BaseTools/Bin/Win32/GenPage.exe b/BaseTools/Bin/Win32/GenPage.exe Binary files differindex 9a1a566ddf..41ac4348e1 100755 --- a/BaseTools/Bin/Win32/GenPage.exe +++ b/BaseTools/Bin/Win32/GenPage.exe diff --git a/BaseTools/Bin/Win32/GenSec.exe b/BaseTools/Bin/Win32/GenSec.exe Binary files differindex aafcdcc5e0..0c828b8919 100755 --- a/BaseTools/Bin/Win32/GenSec.exe +++ b/BaseTools/Bin/Win32/GenSec.exe diff --git a/BaseTools/Bin/Win32/GenVtf.exe b/BaseTools/Bin/Win32/GenVtf.exe Binary files differindex 26e904afb4..32eb2c1c48 100755 --- a/BaseTools/Bin/Win32/GenVtf.exe +++ b/BaseTools/Bin/Win32/GenVtf.exe diff --git a/BaseTools/Bin/Win32/LzmaCompress.exe b/BaseTools/Bin/Win32/LzmaCompress.exe Binary files differindex ce231f8b7b..8ca0bbc214 100644 --- a/BaseTools/Bin/Win32/LzmaCompress.exe +++ b/BaseTools/Bin/Win32/LzmaCompress.exe diff --git a/BaseTools/Bin/Win32/Split.exe b/BaseTools/Bin/Win32/Split.exe Binary files differindex 222eccf017..4b01ebab3f 100755 --- a/BaseTools/Bin/Win32/Split.exe +++ b/BaseTools/Bin/Win32/Split.exe diff --git a/BaseTools/Bin/Win32/TianoCompress.exe b/BaseTools/Bin/Win32/TianoCompress.exe Binary files differindex 04114bdc7b..b95b67f7cb 100755 --- a/BaseTools/Bin/Win32/TianoCompress.exe +++ b/BaseTools/Bin/Win32/TianoCompress.exe diff --git a/BaseTools/Bin/Win32/VfrCompile.exe b/BaseTools/Bin/Win32/VfrCompile.exe Binary files differindex 32334155a8..e9b9977627 100755 --- a/BaseTools/Bin/Win32/VfrCompile.exe +++ b/BaseTools/Bin/Win32/VfrCompile.exe diff --git a/BaseTools/Bin/Win32/VolInfo.exe b/BaseTools/Bin/Win32/VolInfo.exe Binary files differindex 6e501746c8..ebbe39809f 100755 --- a/BaseTools/Bin/Win32/VolInfo.exe +++ b/BaseTools/Bin/Win32/VolInfo.exe diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c index 2278948b3d..d570f633d5 100644 --- a/BaseTools/Source/C/GenFw/GenFw.c +++ b/BaseTools/Source/C/GenFw/GenFw.c @@ -583,7 +583,21 @@ ScanSections( //
CoffOffset = sizeof(EFI_IMAGE_DOS_HEADER) + 0x40;
NtHdrOffset = CoffOffset;
- CoffOffset += sizeof(EFI_IMAGE_OPTIONAL_HEADER_UNION);
+ switch (Ehdr->e_machine) {
+ case EM_386:
+ case EM_ARM:
+ CoffOffset += sizeof (EFI_IMAGE_NT_HEADERS32);
+ break;
+ case EM_X86_64:
+ case EM_IA_64:
+ CoffOffset += sizeof (EFI_IMAGE_NT_HEADERS64);
+ break;
+ default:
+ VerboseMsg ("%s unknown e_machine type. Assume IA-32", (UINTN)Ehdr->e_machine);
+ CoffOffset += sizeof (EFI_IMAGE_NT_HEADERS32);
+ break;
+ }
+
TableOffset = CoffOffset;
CoffOffset += CoffNbrSections * sizeof(EFI_IMAGE_SECTION_HEADER);
@@ -1144,6 +1158,7 @@ ConvertElf ( //
// Compute sections new address.
//
+
ScanSections();
VerboseMsg ("Compute sections new address.");
@@ -2660,9 +2675,12 @@ Returns: //
// Init variable.
//
- DebugDirectoryEntryRva = 0;
- ExportDirectoryEntryRva = 0;
- ResourceDirectoryEntryRva = 0;
+ DebugDirectoryEntryRva = 0;
+ ExportDirectoryEntryRva = 0;
+ ResourceDirectoryEntryRva = 0;
+ DebugDirectoryEntryFileOffset = 0;
+ ExportDirectoryEntryFileOffset = 0;
+ ResourceDirectoryEntryFileOffset = 0;
DosHdr = (EFI_IMAGE_DOS_HEADER *) FileBuffer;
FileHdr = (EFI_IMAGE_FILE_HEADER *) (FileBuffer + DosHdr->e_lfanew + sizeof (UINT32));
@@ -2745,17 +2763,17 @@ Returns: //
FileHdr->TimeDateStamp = 0;
- if (ExportDirectoryEntryRva != 0) {
+ if (ExportDirectoryEntryFileOffset != 0) {
NewTimeStamp = (UINT32 *) (FileBuffer + ExportDirectoryEntryFileOffset + sizeof (UINT32));
*NewTimeStamp = 0;
}
- if (ResourceDirectoryEntryRva != 0) {
+ if (ResourceDirectoryEntryFileOffset != 0) {
NewTimeStamp = (UINT32 *) (FileBuffer + ResourceDirectoryEntryFileOffset + sizeof (UINT32));
*NewTimeStamp = 0;
}
- if (DebugDirectoryEntryRva != 0) {
+ if (DebugDirectoryEntryFileOffset != 0) {
DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) (FileBuffer + DebugDirectoryEntryFileOffset);
DebugEntry->TimeDateStamp = 0;
if (ZeroDebugFlag) {
|