Revision: 18775
http://sourceforge.net/p/edk2/code/18775
Author: abiesheuvel
Date: 2015-11-12 07:29:21 +0000 (Thu, 12 Nov 2015)
Log Message:
-----------
ArmPlatformPkg: bring DS-5 scripts in line with linker script changes
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 <[email protected]>
Acked-by: Leif Lindholm <[email protected]>
Modified Paths:
--------------
trunk/edk2/ArmPlatformPkg/Scripts/Ds5/firmware_volume.py
Modified: trunk/edk2/ArmPlatformPkg/Scripts/Ds5/firmware_volume.py
===================================================================
--- trunk/edk2/ArmPlatformPkg/Scripts/Ds5/firmware_volume.py 2015-11-12
07:14:40 UTC (rev 18774)
+++ trunk/edk2/ArmPlatformPkg/Scripts/Ds5/firmware_volume.py 2015-11-12
07:29:21 UTC (rev 18775)
@@ -94,10 +94,8 @@
stripped_size = struct.unpack("<H",
self.ec.getMemoryService().read(self.base_te + 0x6, 2, 32))[0]
stripped_size -= EfiSectionTE.SIZEOF_EFI_TE_IMAGE_HEADER
- base_of_code = self.ec.getMemoryService().readMemory32(self.base_te +
0xC)
+ return self.base_te - stripped_size
- return self.base_te + base_of_code - stripped_size
-
class EfiSectionPE32:
def __init__(self, ec, base_pe32):
self.ec = ec
@@ -131,17 +129,8 @@
return filename[0:string.find(filename,'\0')]
def get_debug_elfbase(self):
- # Offset from dos hdr to PE file hdr
- pe_file_header = self.base_pe32 +
self.ec.getMemoryService().readMemory32(self.base_pe32 + 0x3C)
+ return self.base_pe32
- base_of_code = self.base_pe32 +
self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)
- base_of_data = self.base_pe32 +
self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)
-
- if (base_of_code < base_of_data) and (base_of_code != 0):
- return base_of_code
- else:
- return base_of_data
-
class EfiSectionPE64:
def __init__(self, ec, base_pe64):
self.ec = ec
@@ -176,17 +165,8 @@
return filename[0:string.find(filename,'\0')]
def get_debug_elfbase(self):
- # Offset from dos hdr to PE file hdr
- pe_file_header = self.base_pe64 +
self.ec.getMemoryService().readMemory32(self.base_pe64 + 0x3C)
+ return self.base_pe64
- base_of_code = self.base_pe64 +
self.ec.getMemoryService().readMemory32(pe_file_header + 0x28)
- base_of_data = self.base_pe64 +
self.ec.getMemoryService().readMemory32(pe_file_header + 0x2C)
-
- if (base_of_code < base_of_data) and (base_of_code != 0):
- return base_of_code
- else:
- return base_of_data
-
class FirmwareFile:
EFI_FV_FILETYPE_RAW = 0x01
EFI_FV_FILETYPE_FREEFORM = 0x02
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits