The ARM and AARCH64 linker scripts have recently been updated so that
the memory layouts of the ELF and PE/COFF versions of each module are
identical. In particular, this means that the ELF images now have a
hole before the first section rather than starting at offset 0x0, which
means we no longer have to correct for this difference when loading the
ELF image into the debugger.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18775
6f19259b-4bc3-4df7-8a09-
765794883524
stripped_size = struct.unpack("<H", self.ec.getMemoryService().read(self.base_te + 0x6, 2, 32))[0]\r
stripped_size -= EfiSectionTE.SIZEOF_EFI_TE_IMAGE_HEADER\r
\r
stripped_size = struct.unpack("<H", self.ec.getMemoryService().read(self.base_te + 0x6, 2, 32))[0]\r
stripped_size -= EfiSectionTE.SIZEOF_EFI_TE_IMAGE_HEADER\r
\r
- base_of_code = self.ec.getMemoryService().readMemory32(self.base_te + 0xC)\r
-\r
- return self.base_te + base_of_code - stripped_size\r
+ return self.base_te - stripped_size\r
\r
class EfiSectionPE32:\r
def __init__(self, ec, base_pe32):\r
\r
class EfiSectionPE32:\r
def __init__(self, ec, base_pe32):\r
return filename[0:string.find(filename,'\0')]\r
\r
def get_debug_elfbase(self):\r
return filename[0:string.find(filename,'\0')]\r
\r
def get_debug_elfbase(self):\r
- # Offset from dos hdr to PE file hdr\r
- pe_file_header = self.base_pe32 + self.ec.getMemoryService().readMemory32(self.base_pe32 + 0x3C)\r
-\r
- base_of_code = self.base_pe32 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)\r
- base_of_data = self.base_pe32 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)\r
-\r
- if (base_of_code < base_of_data) and (base_of_code != 0):\r
- return base_of_code\r
- else:\r
- return base_of_data\r
+ return self.base_pe32\r
\r
class EfiSectionPE64:\r
def __init__(self, ec, base_pe64):\r
\r
class EfiSectionPE64:\r
def __init__(self, ec, base_pe64):\r
return filename[0:string.find(filename,'\0')]\r
\r
def get_debug_elfbase(self):\r
return filename[0:string.find(filename,'\0')]\r
\r
def get_debug_elfbase(self):\r
- # Offset from dos hdr to PE file hdr\r
- pe_file_header = self.base_pe64 + self.ec.getMemoryService().readMemory32(self.base_pe64 + 0x3C)\r
-\r
- base_of_code = self.base_pe64 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)\r
- base_of_data = self.base_pe64 + self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)\r
-\r
- if (base_of_code < base_of_data) and (base_of_code != 0):\r
- return base_of_code\r
- else:\r
- return base_of_data\r
+ return self.base_pe64\r
\r
class FirmwareFile:\r
EFI_FV_FILETYPE_RAW = 0x01\r
\r
class FirmwareFile:\r
EFI_FV_FILETYPE_RAW = 0x01\r