Home | History | Annotate | Download | only in BasePeCoffLib

Lines Matching refs:Te

2   Base PE/COFF loader supports loading any PE32/PE32+ or TE image, but

33 Adjust some fields in section header for TE image.
36 @param TeStrippedOffset Size adjust for the TE image.
52 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
80 Retrieves the PE or TE Header from a PE/COFF or TE image.
88 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
90 @retval RETURN_SUCCESS The PE or TE Header is read.
91 @retval Other The error status from reading the PE/COFF or TE image using the ImageRead function.
165 if (Hdr.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
167 ImageContext->Machine = Hdr.Te->Machine;
168 ImageContext->ImageType = (UINT16)(Hdr.Te->Subsystem);
175 ImageContext->SizeOfHeaders = sizeof (EFI_TE_IMAGE_HEADER) + (UINTN)Hdr.Te->BaseOfCode - (UINTN)Hdr.Te->StrippedSize;
180 if (sizeof (EFI_TE_IMAGE_HEADER) >= (UINT32)Hdr.Te->StrippedSize) {
188 if (Hdr.Te->BaseOfCode <= Hdr.Te->StrippedSize) {
194 // Read last byte of Hdr.Te->SizeOfHeaders from the file.
213 // TE Image Data Directory Entry size is non-zero, but the Data Directory Virtual Address is zero.
214 // This case is not a valid TE image.
216 if ((Hdr.Te->DataDirectory[0].Size != 0 && Hdr.Te->DataDirectory[0].VirtualAddress == 0) ||
217 (Hdr.Te->DataDirectory[1].Size != 0 && Hdr.Te->DataDirectory[1].VirtualAddress == 0)) {
479 NumberOfSections = (UINTN) (Hdr.Te->NumberOfSections);
506 // Adjust some field in Section Header for TE image.
509 PeCoffLoaderAdjustOffsetForTeImage (&SectionHeader, (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER));
572 If the image is a TE image, then SectionAlignment is set to 0.
644 TeStrippedOffset = (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER);
645 ImageContext->ImageAddress = (PHYSICAL_ADDRESS)(Hdr.Te->ImageBase + TeStrippedOffset);
674 } else if ((ImageContext->IsTeImage) && (Hdr.Te->DataDirectory[0].Size == 0) && (Hdr.Te->DataDirectory[0].VirtualAddress == 0)) {
782 DebugDirectoryEntry = &Hdr.Te->DataDirectory[1];
788 for (Index = 0; Index < Hdr.Te->NumberOfSections;) {
819 if (Index < (UINTN) Hdr.Te->NumberOfSections - 1) {
820 SectionHeaderOffset += (Hdr.Te->NumberOfSections - 1 - Index) * sizeof (EFI_IMAGE_SECTION_HEADER);
821 Index = Hdr.Te->NumberOfSections - 1;
827 // In Te image header there is not a field to describe the ImageSize.
836 if ((++Index) == (UINTN)Hdr.Te->NumberOfSections) {
881 @param TeStrippedOffset Stripped offset for TE image.
1026 Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
1027 TeStrippedOffset = (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER);
1028 Adjust = (UINT64) (BaseAddress - (Hdr.Te->ImageBase + TeStrippedOffset));
1030 Hdr.Te->ImageBase = (UINT64) (BaseAddress - TeStrippedOffset);
1036 RelocDir = &Hdr.Te->DataDirectory[0];
1309 // Read the entire PE/COFF or TE header into memory
1338 Hdr.Te = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);
1343 NumberOfSections = (UINTN) (Hdr.Te->NumberOfSections);
1344 TeStrippedOffset = (UINT32) Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER);
1436 (UINTN)Hdr.Te->AddressOfEntryPoint,
1472 DirectoryEntry = &Hdr.Te->DataDirectory[0];
1521 // Should we apply fix up to this field according to the size difference between PE and TE?
1522 // Because now we maintain TE header fields unfixed, this field will also remain as they are