From nobody Sun Apr 28 21:36:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60195+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60195+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1590355277; cv=none; d=zohomail.com; s=zohoarc; b=FCqI+LKHLrOo/XCtPTs5/Sqkg2V04dBneydg2oWG96QorTv51eNHYtgeLf0ACf0JsRzMQ2wuQXFzqWh1ECT/b/dCT9BxzckLaaypddUpeyb0KuzXlJ/q2YqQ2o0vpyxs+XwCWllKhC4aeKFEaAOn3sB8SwyR9fbrt8iBzoMapWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590355277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=k5C0Z3PC50QZeiFmgYalfhW7RgzBdMuZXhQH0cxZMOM=; b=bX5x1htY0HlXClF/mgDkEx9pOOyytNBjKpzmEdbzQ3FVNjjFP/1fSXdc2xU0FkpvFYWobEo1FrCl0pV4Act2/rR1pIqjeVFUJChBXTCn1SdIMXCkaESprk2Ce0N6nS7XDk+zonJqU2o4wF7JQ3I3YmeQ/grt5LcLNd6LUCXFNJ8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60195+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590355276998405.94465744515514; Sun, 24 May 2020 14:21:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id unNyYY1788612xUtumgre5hT; Sun, 24 May 2020 14:21:16 -0700 X-Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) by mx.groups.io with SMTP id smtpd.web11.21356.1590355275807364840 for ; Sun, 24 May 2020 14:21:16 -0700 X-Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.42/8.16.0.42) with SMTP id 04OLAGnM023177; Sun, 24 May 2020 14:21:14 -0700 X-Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 3170grn9sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 24 May 2020 14:21:14 -0700 X-Received: from rn-mailsvcp-relay-lapp04.rno.apple.com (rn-mailsvcp-relay-lapp04.rno.apple.com [17.179.253.13]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAU00BJ6TZDWO30@rn-mailsvcp-mta-lapp02.rno.apple.com>; Sun, 24 May 2020 14:21:13 -0700 (PDT) X-Received: from process_milters-daemon.rn-mailsvcp-relay-lapp04.rno.apple.com by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QAU00E00TRDPY00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:13 -0700 (PDT) X-Va-A: X-Va-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-Va-E-CD: cf4fecb9c8a9b19ae262ca5c785189cb X-Va-R-CD: 2e8edd17abd14281c501635b68a4ee23 X-Va-CD: 0 X-Va-ID: 7e891096-42ac-4ee6-8d62-48946b9a8b61 X-V-A: X-V-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-V-E-CD: cf4fecb9c8a9b19ae262ca5c785189cb X-V-R-CD: 2e8edd17abd14281c501635b68a4ee23 X-V-CD: 0 X-V-ID: 59ca96ee-5bea-4a19-906e-afd27c112981 X-Received: from rn-mailsvcp-relay-lapp02.rno.apple.com (unknown [17.235.51.71]) by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTP id <0QAU00NJ9TYDAE00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:13 -0700 (PDT) From: "Andrew Fish via groups.io" To: devel@edk2.groups.io Cc: Andrew Fish , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH 1/3] BaseTools/GenFv: Add PE/COFF resource sections injection to GenFw Date: Sun, 24 May 2020 14:20:09 -0700 Message-id: <7471ab95f62b357b59ef22bb1c59ccea43f785a3.1590354726.git.afish@apple.com> In-reply-to: References: MIME-version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,afish@apple.com X-Gm-Message-State: 5P0VX7h98PFTA0NbmhtOIvZRx1787277AA= Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590355276; bh=HcqT13JHqh6yCndMhQL0L4KihSO7oceo06JqHBhi9r0=; h=Cc:Date:From:Reply-To:Subject:To; b=f2+AVF2Osy8F6iIPD+ecRwjf2DY2ET+nh33ldL9j4gomoaoxhyTaWvjkkv/VAqos2un FMBhvJAUXPLdY+jekabxFLGWqYbKtr0kg5U3dHnCQ9QwAEKBuoAi0bipj6vfjBCza46kd Iyu61tFvvIC618Ae91Tsf06Boq4XjnC6q+A= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D557 The XCODE toolchain does not suport injecting resource sections via libraries so add --rc to GenFw to inject $(MODULE_NAME)hii.rc into the final PE/COFF image. Since moving exiting code around would break source level debugging we must reuse an existing empty section, or add a new section header. If there is not space to add a new section header append to the last section. The resource entry if found via a directory entry so the PE/COFF loading code does not depend on the section type. Signed-off-by: Andrew Fish Cc: Bob Feng Cc: Liming Gao --- BaseTools/Source/C/GenFw/GenFw.c | 370 +++++++++++++++++++++++++++++++ 1 file changed, 370 insertions(+) diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/Ge= nFw.c index 8cab70ba4d5f..748af5dff259 100644 --- a/BaseTools/Source/C/GenFw/GenFw.c +++ b/BaseTools/Source/C/GenFw/GenFw.c @@ -96,6 +96,16 @@ ZeroDebugData ( BOOLEAN ZeroDebug ); =20 +STATIC +EFI_STATUS +PatchResourceData ( + IN UINT32 Type, + IN UINT8 *ResourceData, + IN UINT32 ResourceDataSize, + IN OUT UINT8 **PeCoff, + IN OUT UINT32 *PeCoffSize + ); + STATIC EFI_STATUS SetStamp ( @@ -267,6 +277,11 @@ Returns: except for -o option. It is a action option.\n\ If it is combined with other action options, the l= ater\n\ input action option will override the previous one= .\n"); + fprintf (stdout, " --rc FlieName Append a Hii resource section = to the\n\ + last PE/COFF section. The FileName is the resource= section to append\n\ + If FileName does not exist this operation is skipp= ed. This feature is\n\ + only intended for toolchains, like XCODE, that don= 't suport $(RC).\n\ + This option can only be combined with -e\n"); fprintf (stdout, " --rebase NewAddress Rebase image to new base addre= ss. New address \n\ is also set to the first none code section header.= \n\ It can't be combined with other action options\n\ @@ -1059,10 +1074,12 @@ Returns: CHAR8 **InputFileName; char *OutImageName; char *ModuleType; + char *RcFileName; CHAR8 *TimeStamp; FILE *fpIn; FILE *fpOut; FILE *fpInOut; + FILE *fpRc; UINT32 Data; UINT32 *DataPointer; UINT32 *OldDataPointer; @@ -1080,6 +1097,8 @@ Returns: UINT32 OutputFileLength; UINT8 *InputFileBuffer; UINT32 InputFileLength; + UINT8 *RcFileBuffer; + UINT32 RcFileLength; RUNTIME_FUNCTION *RuntimeFunction; UNWIND_INFO *UnwindInfo; STATUS Status; @@ -1116,6 +1135,7 @@ Returns: time_t OutputFileTime; struct stat Stat_Buf; BOOLEAN ZeroDebugFlag; + BOOLEAN InsertRcFile; =20 SetUtilityName (UTILITY_NAME); =20 @@ -1128,6 +1148,7 @@ Returns: mInImageName =3D NULL; OutImageName =3D NULL; ModuleType =3D NULL; + RcFileName =3D NULL; Type =3D 0; Status =3D STATUS_SUCCESS; FileBuffer =3D NULL; @@ -1164,6 +1185,7 @@ Returns: InputFileTime =3D 0; OutputFileTime =3D 0; ZeroDebugFlag =3D FALSE; + InsertRcFile =3D FALSE; =20 if (argc =3D=3D 1) { Error (NULL, 0, 1001, "Missing options", "No input options."); @@ -1436,6 +1458,20 @@ Returns: continue; } =20 + if (stricmp (argv[0], "--rc") =3D=3D 0) { + RcFileName =3D argv[1]; + argc -=3D 2; + argv +=3D 2; + + if (stat (RcFileName, &Stat_Buf) =3D=3D 0) { + // + // File exists + // + InsertRcFile =3D TRUE; + } + continue; + } + if (argv[0][0] =3D=3D '-') { Error (NULL, 0, 1000, "Unknown option", argv[0]); goto Finish; @@ -1568,6 +1604,10 @@ Returns: break; } =20 + if (InsertRcFile) { + VerboseMsg ("RC input file %s", RcFileName); + } + if (ReplaceFlag) { VerboseMsg ("Overwrite the input file with the output content."); } @@ -2052,6 +2092,52 @@ Returns: } } =20 + // + // Insert Resources into the image. + // + if (InsertRcFile) { + fpRc =3D fopen (LongFilePath (RcFileName), "rb"); + if (fpRc =3D=3D NULL) { + Error (NULL, 0, 0001, "Error opening file", RcFileName); + goto Finish; + } + + RcFileLength =3D _filelength (fileno (fpRc)); + RcFileBuffer =3D malloc (RcFileLength); + if (FileBuffer =3D=3D NULL) { + Error (NULL, 0, 4001, "Resource", "memory cannot be allocated!"); + fclose (fpRc); + goto Finish; + } + + fread (RcFileBuffer, 1, RcFileLength, fpRc); + fclose (fpRc); + + Status =3D PatchResourceData (Type, RcFileBuffer, RcFileLength, &FileB= uffer, &FileLength); + if (EFI_ERROR (Status)) { + Error (NULL, 0, 3000, "Invalid", "RC Patch Data Error status is 0x%x= ", (int) Status); + goto Finish; + } + + fpOut =3D fopen (LongFilePath (OutImageName), "wb"); + if (fpOut =3D=3D NULL) { + Error (NULL, 0, 0001, "Error opening output file", OutImageName); + goto Finish; + } + + fwrite (FileBuffer, 1, FileLength, fpOut); + + fclose (fpOut); + fpOut =3D NULL; + VerboseMsg ("the size of output file is %u bytes", (unsigned) FileLeng= th); + + // + // Write the updated Image + // + goto Finish; + } + + // // Convert ELF image to PeImage // @@ -2761,6 +2847,290 @@ Finish: return GetUtilityStatus (); } =20 +#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) = & ((Alignment) - 1))) + +STATIC +EFI_STATUS +PatchResourceData ( + IN UINT32 Type, + IN UINT8 *ResourceData, + IN UINT32 ResourceDataSize, + IN OUT UINT8 **PeCoff, + IN OUT UINT32 *PeCoffSize + ) +/*++ + +Routine Description: + + Embed Resource data into a PE/COFF image. + + If there is free space between the header and the image add a new + .rsrc section to the PE/COFF image. If no space exists then append + the resource data to the last section. + +Arguments: + + Type - If not zero them update PE/COFF header module type. + ResourceData - *hii.rc data to insert into the image. + ResourceDataSize - Size of ResourceData in bytes. + PeCoff - On input existing PE/COFF, on output input PE/COFF wi= th + ResourceData embedded. + PeCoffSize - Size of PeCoff in bytes. + +Returns: + + EFI_ABORTED - PeImage is invalid. + EFI_SUCCESS - Zero debug data successfully. + +--*/ +{ + UINT8 *FileBuffer; + UINT32 FileBufferSize; + EFI_IMAGE_DOS_HEADER *DosHdr; + EFI_IMAGE_FILE_HEADER *FileHdr; + EFI_IMAGE_OPTIONAL_HEADER32 *Optional32Hdr; + EFI_IMAGE_OPTIONAL_HEADER64 *Optional64Hdr; + EFI_IMAGE_SECTION_HEADER *SectionHeader; + UINT32 FileAlignment; + UINT32 Max; + INTN LastSection; + INTN EmptySection; + UINT32 ActualHeaderSize; + UINT32 StartingPeCoffSize; + UINT32 NewHeaderSize; + CHAR8 *Base; + EFI_IMAGE_RESOURCE_DIRECTORY *ResourceDirectory; + EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *ResourceDirectoryEntry; + EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString; + EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry; + EFI_IMAGE_DATA_DIRECTORY *DirectoryEntry; + CHAR16 *String; + UINT32 Offset; + UINT32 Index; + + // + // Grow the file in units of FileAlignment + // + DosHdr =3D (EFI_IMAGE_DOS_HEADER *) *PeCoff; + if (DosHdr->e_magic !=3D EFI_IMAGE_DOS_SIGNATURE) { + // NO DOS header, must start with PE/COFF header + FileHdr =3D (EFI_IMAGE_FILE_HEADER *)(*PeCoff + sizeof (UINT32)); + } else { + FileHdr =3D (EFI_IMAGE_FILE_HEADER *)(*PeCoff + DosHdr->e_lfanew + si= zeof (UINT32)); + } + + Optional32Hdr =3D (EFI_IMAGE_OPTIONAL_HEADER32 *) ((UINT8*) FileHdr + si= zeof (EFI_IMAGE_FILE_HEADER)); + Optional64Hdr =3D (EFI_IMAGE_OPTIONAL_HEADER64 *) ((UINT8*) FileHdr + si= zeof (EFI_IMAGE_FILE_HEADER)); + if (Optional32Hdr->Magic =3D=3D EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { + FileAlignment =3D Optional32Hdr->FileAlignment; + SectionHeader =3D (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional= 32Hdr + FileHdr->SizeOfOptionalHeader); + } else { + FileAlignment =3D Optional64Hdr->FileAlignment; + SectionHeader =3D (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional= 64Hdr + FileHdr->SizeOfOptionalHeader); + } + + LastSection =3D -1; + for (Index =3D 0, Max =3D 0; Index < FileHdr->NumberOfSections; Index++)= { + if (SectionHeader[Index].PointerToRawData > Max) { + Max =3D SectionHeader[Index].PointerToRawData; + LastSection =3D Index; + } + } + + EmptySection =3D -1; + for (Index =3D 0; Index < FileHdr->NumberOfSections; Index++) { + if ((SectionHeader[Index].Misc.VirtualSize =3D=3D 0) && (SectionHeader= [Index].SizeOfRawData =3D=3D 0)) { + // + // No Data or Zero Fill so we can repurpose this entry. + // + EmptySection =3D Index; + break; + } + } + + if (EmptySection =3D=3D -1) { + ActualHeaderSize =3D (UINTN)(&SectionHeader[FileHdr->NumberOfSections]= ) - (UINTN)*PeCoff; + if ((ActualHeaderSize + sizeof (EFI_IMAGE_SECTION_HEADER)) <=3D Option= al32Hdr->SizeOfHeaders) { + // + // There is space to inject a new section. + // + FileHdr->NumberOfSections +=3D 1; + EmptySection =3D Index; + } + } + + StartingPeCoffSize =3D SectionHeader[LastSection].PointerToRawData + Sec= tionHeader[LastSection].SizeOfRawData; + if (SectionHeader[LastSection].Misc.VirtualSize > SectionHeader[LastSect= ion].SizeOfRawData) { + StartingPeCoffSize +=3D SectionHeader[LastSection].Misc.VirtualSize - = SectionHeader[LastSection].SizeOfRawData; + } + + FileBufferSize =3D ALIGN_VALUE(StartingPeCoffSize + ResourceDataSize= , FileAlignment); + FileBuffer =3D malloc (FileBufferSize); + if (FileBuffer =3D=3D NULL) { + return RETURN_OUT_OF_RESOURCES; + } + memset (FileBuffer, 0, FileBufferSize); + + // + // Append the Resource Data to the end of the PE/COFF image. + // + NewHeaderSize =3D Optional32Hdr->SizeOfHeaders; + CopyMem (FileBuffer, *PeCoff, (StartingPeCoffSize > *PeCoffSize) ? *PeC= offSize: StartingPeCoffSize); + CopyMem (FileBuffer + StartingPeCoffSize, ResourceData, ResourceDataSize= ); + + free (*PeCoff); + *PeCoff =3D FileBuffer; + *PeCoffSize =3D FileBufferSize; + + DosHdr =3D (EFI_IMAGE_DOS_HEADER *)FileBuffer; + if (DosHdr->e_magic !=3D EFI_IMAGE_DOS_SIGNATURE) { + // NO DOS header, must start with PE/COFF header + FileHdr =3D (EFI_IMAGE_FILE_HEADER *)(FileBuffer + sizeof (UINT32)); + } else { + FileHdr =3D (EFI_IMAGE_FILE_HEADER *)(FileBuffer + DosHdr->e_lfanew += sizeof (UINT32)); + } + + // + // Get Resource EntryTable offset, and Section header + // + Optional32Hdr =3D (EFI_IMAGE_OPTIONAL_HEADER32 *) ((UINT8*) FileHdr + si= zeof (EFI_IMAGE_FILE_HEADER)); + Optional64Hdr =3D (EFI_IMAGE_OPTIONAL_HEADER64 *) ((UINT8*) FileHdr + si= zeof (EFI_IMAGE_FILE_HEADER)); + DirectoryEntry =3D NULL; + if (Optional32Hdr->Magic =3D=3D EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { + SectionHeader =3D (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional32Hd= r + FileHdr->SizeOfOptionalHeader); + if (Optional32Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RES= OURCE) { + DirectoryEntry =3D &Optional32Hdr->DataDirectory[EFI_IMAGE_DIRECTORY= _ENTRY_RESOURCE]; + } + } else { + SectionHeader =3D (EFI_IMAGE_SECTION_HEADER *) ((UINT8 *) Optional64Hd= r + FileHdr->SizeOfOptionalHeader); + if (Optional64Hdr->NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_RES= OURCE) { + DirectoryEntry =3D &Optional64Hdr->DataDirectory[EFI_IMAGE_DIRECTORY= _ENTRY_RESOURCE]; + } + } + + if (DirectoryEntry =3D=3D NULL) { + return RETURN_OUT_OF_RESOURCES; + } + + if (EmptySection !=3D -1) { + // + // Create a new section + // + CopyMem (SectionHeader[EmptySection].Name, ".rsrc\0\0\0", EFI_IMAGE_SI= ZEOF_SHORT_NAME); + SectionHeader[EmptySection].Misc.VirtualSize =3D ResourceDataSize; + SectionHeader[EmptySection].VirtualAddress =3D StartingPeCoffSize; + SectionHeader[EmptySection].SizeOfRawData =3D ALIGN_VALUE(ResourceD= ataSize, FileAlignment); + SectionHeader[EmptySection].PointerToRawData =3D StartingPeCoffSize; + + SectionHeader[EmptySection].Characteristics =3D EFI_IMAGE_SCN_MEM_EXE= CUTE | EFI_IMAGE_SCN_MEM_READ; + SectionHeader[EmptySection].Characteristics |=3D EFI_IMAGE_SCN_CNT_INI= TIALIZED_DATA | EFI_IMAGE_SCN_CNT_CODE; + + DirectoryEntry->VirtualAddress =3D SectionHeader[EmptySection].Virtual= Address; + } else { + // + // Grow the last section to include the resources. + // For Xcode this is always the .debug section. + // + SectionHeader[LastSection].SizeOfRawData =3D ALIGN_VALUE(SectionHeader= [LastSection].SizeOfRawData + ResourceDataSize, FileAlignment); + + // + // Make sure the Virtual Size uses the file aligned actual size, since= we are growing the file. + // + SectionHeader[LastSection].Misc.VirtualSize =3D SectionHeader[LastSect= ion].SizeOfRawData; + + DirectoryEntry->VirtualAddress =3D StartingPeCoffSize; + } + DirectoryEntry->Size =3D ResourceDataSize; + + Optional32Hdr->SizeOfImage =3D ALIGN_VALUE(*PeCoffSize, Optional32Hdr->S= ectionAlignment); + if (Type !=3D 0) { + Optional32Hdr->Subsystem =3D Type; + } + + // + // It looks like the ResourceDataEntry->OffsetToData is relative to the = rc file, + // but PeCoffLoaderLoadImage() assumes it is a PE/COFF VirtualAddress so= we need + // to fix it up. Walk the ResourceDataEntry just like PeCoffLoaderLoadIm= age() and + // patch it. + // + Base =3D (CHAR8 *)(FileBuffer + StartingPeCoffSize); + ResourceDirectory =3D (EFI_IMAGE_RESOURCE_DIRECTORY *)Base; + ResourceDirectoryEntry =3D (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *)(Resour= ceDirectory + 1); + + for (Index =3D 0; Index < ResourceDirectory->NumberOfNamedEntries; Index= ++) { + if (ResourceDirectoryEntry->u1.s.NameIsString) { + // + // Check the ResourceDirectoryEntry->u1.s.NameOffset before use it. + // + if (ResourceDirectoryEntry->u1.s.NameOffset >=3D DirectoryEntry->Siz= e) { + return RETURN_UNSUPPORTED; + } + ResourceDirectoryString =3D (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) = (Base + ResourceDirectoryEntry->u1.s.NameOffset); + String =3D &ResourceDirectoryString->String[0]; + + if (ResourceDirectoryString->Length =3D=3D 3 && + String[0] =3D=3D L'H' && + String[1] =3D=3D L'I' && + String[2] =3D=3D L'I') { + // + // Resource Type "HII" found + // + if (ResourceDirectoryEntry->u2.s.DataIsDirectory) { + // + // Move to next level - resource Name + // + if (ResourceDirectoryEntry->u2.s.OffsetToDirectory >=3D Director= yEntry->Size) { + return RETURN_UNSUPPORTED; + } + ResourceDirectory =3D (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base + R= esourceDirectoryEntry->u2.s.OffsetToDirectory); + Offset =3D ResourceDirectoryEntry->u2.s.OffsetToDirectory + size= of (EFI_IMAGE_RESOURCE_DIRECTORY) + + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * (Resource= Directory->NumberOfNamedEntries + ResourceDirectory->NumberOfIdEntries); + if (Offset > DirectoryEntry->Size) { + return RETURN_UNSUPPORTED; + } + ResourceDirectoryEntry =3D (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *= ) (ResourceDirectory + 1); + + if (ResourceDirectoryEntry->u2.s.DataIsDirectory) { + // + // Move to next level - resource Language + // + if (ResourceDirectoryEntry->u2.s.OffsetToDirectory >=3D Direct= oryEntry->Size) { + return RETURN_UNSUPPORTED; + } + ResourceDirectory =3D (EFI_IMAGE_RESOURCE_DIRECTORY *) (Base += ResourceDirectoryEntry->u2.s.OffsetToDirectory); + Offset =3D ResourceDirectoryEntry->u2.s.OffsetToDirectory + si= zeof (EFI_IMAGE_RESOURCE_DIRECTORY) + + sizeof (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY) * (Resour= ceDirectory->NumberOfNamedEntries + ResourceDirectory->NumberOfIdEntries); + if (Offset > DirectoryEntry->Size) { + return RETURN_UNSUPPORTED; + } + ResourceDirectoryEntry =3D (EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY= *) (ResourceDirectory + 1); + } + } + + // + // Now it ought to be resource Data + // + if (!ResourceDirectoryEntry->u2.s.DataIsDirectory) { + if (ResourceDirectoryEntry->u2.OffsetToData >=3D DirectoryEntry-= >Size) { + return RETURN_UNSUPPORTED; + } + ResourceDataEntry =3D (EFI_IMAGE_RESOURCE_DATA_ENTRY *) (Base + = ResourceDirectoryEntry->u2.OffsetToData); + + // + // Adjust OffsetToData to be a PE/COFF Virtual address in the up= dated image. + // + ResourceDataEntry->OffsetToData +=3D (UINTN)DirectoryEntry->Vir= tualAddress; + break; + } + } + } + ResourceDirectoryEntry++; + } + + return EFI_SUCCESS; +} + + STATIC EFI_STATUS ZeroDebugData ( --=20 2.24.1 (Apple Git-126) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60195): https://edk2.groups.io/g/devel/message/60195 Mute This Topic: https://groups.io/mt/74445735/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 21:36:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60196+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60196+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1590355281; cv=none; d=zohomail.com; s=zohoarc; b=S91SFfptInz9YOPtQgEBY4JROfsQxwl+840RU9VDvQzi5KUJ0NK+RWDuOocUyTu0pkrhns2Fc5ZXI5VxtisyioEJq21ukPYKESMX/UZHC/8R8ObAHRSblw8M2hnJ/u5OZ8qefk/4m8dRS1mrAdRnAr0YVjGs5RxpBCnksEF7Kuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590355281; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=dDEkBZuxhg6IOHnEAykmCfZ/aE8Xni3OhXY7CdhcGPU=; b=nghtTSaajTLzvL2vMJz7kB0tc6wDmc0YALRKYHEghXIga7vYjSQd9/oDcpKzs+UO6LM7IwAKR83J7/OcOjSC4b/RtAN+g+ipmd8PoyW9DhgTFSvvQjD4KmrLSaVoRAe4Kq//Q1zI9J/ehfXVtq3o+Zjwi1Kk/P+ThEeKwdRnQmc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60196+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590355281391400.1633993976981; Sun, 24 May 2020 14:21:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cuRuYY1788612xLe749NM2gX; Sun, 24 May 2020 14:21:21 -0700 X-Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web10.21314.1590355277504779529 for ; Sun, 24 May 2020 14:21:17 -0700 X-Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 04OLBSVm008435; Sun, 24 May 2020 14:21:16 -0700 X-Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 3172tubtks-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 24 May 2020 14:21:16 -0700 X-Received: from rn-mailsvcp-relay-lapp04.rno.apple.com (rn-mailsvcp-relay-lapp04.rno.apple.com [17.179.253.13]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAU00J0WTZF6340@rn-mailsvcp-mta-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:15 -0700 (PDT) X-Received: from process_milters-daemon.rn-mailsvcp-relay-lapp04.rno.apple.com by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QAU00E00TR7MK00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:15 -0700 (PDT) X-Va-A: X-Va-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-Va-E-CD: 44287a5d50130550c9eccc1389f66aaf X-Va-R-CD: 341f8b92c5c1086d18357726cbc3ce00 X-Va-CD: 0 X-Va-ID: c61b629a-828d-4dbb-ab09-4f8f45c14bee X-V-A: X-V-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-V-E-CD: 44287a5d50130550c9eccc1389f66aaf X-V-R-CD: 341f8b92c5c1086d18357726cbc3ce00 X-V-CD: 0 X-V-ID: ef4ff659-d9a8-4b92-ac32-07a7507a58b4 X-Received: from rn-mailsvcp-relay-lapp02.rno.apple.com (unknown [17.235.51.71]) by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTP id <0QAU00NJ9TYDAE00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:15 -0700 (PDT) From: "Andrew Fish via groups.io" To: devel@edk2.groups.io Cc: Andrew Fish , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH 2/3] BaseTools: Add PE/COFF resource sections support for XCODE Date: Sun, 24 May 2020 14:20:10 -0700 Message-id: In-reply-to: References: MIME-version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,afish@apple.com X-Gm-Message-State: LzdTiYwUXwgtZxmTHKyOW0EFx1787277AA= Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590355281; bh=HLpKFu2ItjatMIl+fqKeflz3N/jQUdmRs6EzcIsS8vQ=; h=Cc:Date:From:Reply-To:Subject:To; b=o1Qhx/YD5jmmRCZ2PLW9jptOtSUaeC5JxtorEGqAQJ0IynjcvM/kHAd7uEEZ8PHIK6g Bjj5svHBuIXFuqXYsE8ZCI3ilQGzFyX5Fe0tzXfRUCI7O0hTH5V853x7gXbaQAOX3FiMr tuTkWxUcuYaXJGSwyJFhvkd6FE+t6Z9fGYc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D557 Build a nul lib in [Hii-Binary-Package.UEFI_HII] so the makefile dependencies are satisfied. Add --rc to Genfw in [Dynamic-Library-File] to inject the *hii.rc data if it exists. Signed-off-by: Andrew Fish Cc: Bob Feng Cc: Liming Gao Signed-off-by: Andrew Fish --- BaseTools/Conf/build_rule.template | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule= .template index 0822b681fcd9..00f729a40003 100755 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -393,7 +393,7 @@ "$(MTOC)" -subsystem $(MODULE_TYPE) $(MTOC_FLAGS) ${src} $(DEBU= G_DIR)(+)$(MODULE_NAME).pecoff # create symbol file for GDB debug -$(DSYMUTIL) ${src} - "$(GENFW)" -e $(MODULE_TYPE) -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAM= E).pecoff $(GENFW_FLAGS) + "$(GENFW)" -e $(MODULE_TYPE) --rc $(OUTPUT_DIR)(+)$(MODULE_NAME)hi= i.rc -o ${dst} $(DEBUG_DIR)(+)$(MODULE_NAME).pecoff $(GENFW_FLAGS) $(CP) ${dst} $(DEBUG_DIR) $(CP) ${dst} $(BIN_DIR)(+)$(MODULE_NAME_GUID).efi -$(CP) $(DEBUG_DIR)(+)*.map $(OUTPUT_DIR) @@ -645,10 +645,10 @@ *.hpk =20 - + $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.lib =20 - + $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc =20 @@ -659,5 +659,12 @@ "$(GENFW)" -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUI= D) --hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS) "$(RC)" $(RC_FLAGS) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc ${dst} =20 - + GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --= hiibinpackage $(HII_BINARY_PACKAGES) + + + GenFw -o $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.rc -g $(MODULE_GUID) --= hiibinpackage $(HII_BINARY_PACKAGES) $(GENFW_FLAGS) + # Fake a lib that is empty for a make dependency like toolchains w= ith a real RC tool. + echo "int aksdlfjlksdfjlksslkdfj;" > $(OUTPUT_DIR)(+)$(MODULE_NAME= )hii.hhi.c; + "$(CC)" $(DEPS_FLAGS) $(CC_FLAGS) -o $(OUTPUT_DIR)(+)$(MODULE_NAME= )hii.hii.o $(INC) $(OUTPUT_DIR)(+)$(MODULE_NAME)hii.hhi.c + "$(SLINK)" $(SLINK_FLAGS) ${dst} $(OUTPUT_DIR)(+)$(MODULE_NAME)hi= i.hii.o --=20 2.24.1 (Apple Git-126) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60196): https://edk2.groups.io/g/devel/message/60196 Mute This Topic: https://groups.io/mt/74445736/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun Apr 28 21:36:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60197+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60197+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1590355281; cv=none; d=zohomail.com; s=zohoarc; b=bMy2/Yehicg1Swq7UTPnf2WhksqF3y9c0f+CwhrTaXHrsKYiJTdX7Bpb2Vne/TOXys7Jade534dw5UPhs+iSyKq3dnlEHDfQDq5PzGT3fMxil5dRvWaDD60O+OaHoRkFH1MvCQV+nwyF9/rJ/Dk4Reoe2CDKtceA+E4gdEATF6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590355281; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wpxwr319dzXFrVC2ioCYweNQfb/SapODufVv5W7m+PI=; b=iaZpXFK0ZG4f6JmC5vrLkJN0ethPJVL3zNY5oBlIUCu5I/pWAMN31ZO9rOQLhWpRCS0AKVmwNrYA3RZCBFK3KMFo0+j1628j2SsDRXk+7P9Hf6RvAZK5dhmSIRW/QpQWm400uZl92KgALhhX8Ikd3XBdQEbKNgq0NkE8fLw0/hw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60197+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1590355281864734.1616154834635; Sun, 24 May 2020 14:21:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2JFdYY1788612x6uMmdbiDes; Sun, 24 May 2020 14:21:21 -0700 X-Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web10.21316.1590355279981045202 for ; Sun, 24 May 2020 14:21:20 -0700 X-Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 04OLBSVp008435; Sun, 24 May 2020 14:21:16 -0700 X-Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 3172tubtks-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 24 May 2020 14:21:16 -0700 X-Received: from rn-mailsvcp-relay-lapp04.rno.apple.com (rn-mailsvcp-relay-lapp04.rno.apple.com [17.179.253.13]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTPS id <0QAU00J0YTZG6340@rn-mailsvcp-mta-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:16 -0700 (PDT) X-Received: from process_milters-daemon.rn-mailsvcp-relay-lapp04.rno.apple.com by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) id <0QAU00E00TR7MK00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:16 -0700 (PDT) X-Va-A: X-Va-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-Va-E-CD: 31370a619bc63566ab9206dfd03ab4c3 X-Va-R-CD: 8e4877de4c05e0cb3c576bcd87c903b5 X-Va-CD: 0 X-Va-ID: 9a05a763-5e90-4c4c-980e-dd82ebfa5942 X-V-A: X-V-T-CD: 678bf7de5df0d9ff994f556fd1b44182 X-V-E-CD: 31370a619bc63566ab9206dfd03ab4c3 X-V-R-CD: 8e4877de4c05e0cb3c576bcd87c903b5 X-V-CD: 0 X-V-ID: bf0ce6c6-3094-4aa8-955d-d350121ab779 X-Received: from rn-mailsvcp-relay-lapp02.rno.apple.com (unknown [17.235.51.71]) by rn-mailsvcp-relay-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.5.20200312 64bit (built Mar 12 2020)) with ESMTP id <0QAU00NJ9TYDAE00@rn-mailsvcp-relay-lapp04.rno.apple.com>; Sun, 24 May 2020 14:21:16 -0700 (PDT) From: "Andrew Fish via groups.io" To: devel@edk2.groups.io Cc: Andrew Fish , Ard Biesheuvel , Jiewen Yao , Jordan Justen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [edk2-devel] [PATCH 3/3] OvmfwPkg: Don't exclude XCODE Modules Date: Sun, 24 May 2020 14:20:11 -0700 Message-id: <215ac3c5d0c73779d06b6d7463000ee8d1d526fe.1590354726.git.afish@apple.com> In-reply-to: References: MIME-version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,afish@apple.com X-Gm-Message-State: pyAHIWJtkHahyptORv4D25lOx1787277AA= Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1590355281; bh=p6blcttpZPGraA9kE8lYt0JDIC9byMCIomhkF901YBU=; h=Cc:Content-type:Date:From:Reply-To:Subject:To; b=Mw1CvQa8jlDuPRkEnTjjHExanqHLiWDFl0sDUy+EvtGY5lT+S6vWEh4xcPbKIXyWTWn JgJ8HWTB2LT0wIqBYFH2AlKy8rO8GPstWWtsS74WcvBwhVxmzloH2G8h8ktXrFfVTSMZU dfOTTn3DxgTN4eG5tGsjVuG1Ui+LQggW+fg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" With this BZ getting fixed we no longer need to special case XCODE. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Philippe Mathieu-Daud=C3=A9 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D557 Signed-off-by: Andrew Fish Signed-off-by: Andrew Fish --- OvmfPkg/OvmfPkgIa32.dsc | 3 +-- OvmfPkg/OvmfPkgIa32.fdf | 2 -- OvmfPkg/OvmfPkgIa32X64.dsc | 4 ++-- OvmfPkg/OvmfPkgIa32X64.fdf | 2 -- OvmfPkg/OvmfPkgX64.dsc | 3 +-- OvmfPkg/OvmfPkgX64.fdf | 2 -- OvmfPkg/OvmfXen.dsc | 3 +-- OvmfPkg/OvmfXen.fdf | 2 -- 8 files changed, 5 insertions(+), 16 deletions(-) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index d0df9cbbfb2b..8166d1588ae5 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -878,7 +878,6 @@ [Components] OvmfPkg/Csm/Csm16/Csm16.inf !endif =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE @@ -887,7 +886,7 @@ [Components] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } -!endif + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index e2b759aa8d05..cb1a8b1eba60 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -288,10 +288,8 @@ [FV.DXEFV] INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand= .inf -!endif INF ShellPkg/Application/Shell/Shell.inf =20 INF MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index b3ae62fee92b..e60d25db575e 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -892,7 +892,7 @@ [Components.X64] OvmfPkg/Csm/Csm16/Csm16.inf !endif =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" + ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE @@ -901,7 +901,7 @@ [Components.X64] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } -!endif + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index bfca1eff9e83..4cd4dd652a9f 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -289,10 +289,8 @@ [FV.DXEFV] INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand= .inf -!endif INF ShellPkg/Application/Shell/Shell.inf =20 INF MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index f7fe75ebf531..3b46bce5a6e0 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -888,7 +888,6 @@ [Components] OvmfPkg/Csm/Csm16/Csm16.inf !endif =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE @@ -897,7 +896,7 @@ [Components] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } -!endif + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index bfca1eff9e83..4cd4dd652a9f 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -289,10 +289,8 @@ [FV.DXEFV] INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand= .inf -!endif INF ShellPkg/Application/Shell/Shell.inf =20 INF MdeModulePkg/Logo/LogoDxe.inf diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 3af0ee705407..0c11d4732628 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -670,7 +670,6 @@ [Components] OvmfPkg/Csm/Csm16/Csm16.inf !endif =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE @@ -679,7 +678,7 @@ [Components] gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } -!endif + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf diff --git a/OvmfPkg/OvmfXen.fdf b/OvmfPkg/OvmfXen.fdf index d9ee14b484a0..e81689292313 100644 --- a/OvmfPkg/OvmfXen.fdf +++ b/OvmfPkg/OvmfXen.fdf @@ -361,10 +361,8 @@ [FV.DXEFV] INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf =20 -!if $(TOOL_CHAIN_TAG) !=3D "XCODE5" INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand= .inf -!endif INF ShellPkg/Application/Shell/Shell.inf =20 INF MdeModulePkg/Logo/LogoDxe.inf --=20 2.24.1 (Apple Git-126) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60197): https://edk2.groups.io/g/devel/message/60197 Mute This Topic: https://groups.io/mt/74445737/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-