/* Return the section header specified by the range. */
Elf64_Shdr* GetElf64SectionByRange(IN UINT8 *ImageBase, IN UINT64 Offset, IN UINT64 Size)
/* Return the section header specified by the range. */
Elf64_Shdr* GetElf64SectionByRange(IN UINT8 *ImageBase, IN UINT64 Offset, IN UINT64 Size)
{
  UINT32      Index;
  Elf64_Ehdr  *Ehdr;
  Elf64_Shdr  *Shdr;
  Ehdr = (Elf64_Ehdr *)ImageBase;
  Shdr = (Elf64_Shdr *)(ImageBase + Ehdr->e_shoff);
  for (Index = 0; Index < Ehdr->e_shnum; Index++) {
    if ((Shdr->sh_offset == Offset) && (Shdr->sh_size == Size)) {
      return Shdr;
    }
    Shdr = ELF_NEXT_ENTRY (Elf64_Shdr, Shdr, Ehdr->e_shentsize);
  }
  return NULL;
}