From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web11.2466.1629575785945108520 for ; Sat, 21 Aug 2021 12:56:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=lOFjLQMN; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 401FC240107 for ; Sat, 21 Aug 2021 21:56:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1629575784; bh=mgI+1ofJ8McQvpM6IUgDPjEjtY4Jzvw3v1Nm/CsZx4c=; h=From:To:Cc:Subject:Date:From; b=lOFjLQMNhBKuUdB7a1ulBbDMIihrfGIoaE69qC/JLz3FWBr6yphki+qNq0wXYNA9o UHB5VIM/WEhZG8q64RznfmkRLrQt0zjiHMIVt7E2tR2thNFKvf8eGJkNH3HrfXtaDY RnSyGV0xL4i37JztfCWsiPMtxyFDF6DS/perpvmhI99bTLXDDlUDilNbWSsRj/2eSS m7uFq//2HYMf9lKn/rbCfWbydb5lrqg54nqL38IIcowaGKYtLwedQGwt/EJ7LNbQe5 Vvq8BPPvLkn5BcsKqP7gN+NpN/y78nOI1yXTCJf+b6Sr+K1HC7OScLg3DUPRPwBjc1 eUpJhOhgVOUbg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GsTlq6FDjz9rxL; Sat, 21 Aug 2021 21:56:23 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Vitaly Cheptsov Subject: [PATCH 3/3] ArmPkg: Use Image base address for RVCT symbols loading Date: Sat, 21 Aug 2021 19:55:50 +0000 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The initial import of the RVCT debug code used 0 for the address of the first Image section [1]. This commit has been made in 2010, when "--ro-base 0" was still passed as a build argument [2]. In 2015, this was changed to mirror the PE/COFF memory layout the same way that ELF does [3]. Update the corresponding debug code to no longer manually account for the PE/COFF header offset. [1] https://github.com/mhaeuser/edk2/commit/62e797a489341b13a095b3cd7c0f7bd= 9eac12efe [2] https://github.com/mhaeuser/edk2/blob/62e797a489341b13a095b3cd7c0f7bd9e= ac12efe/BaseTools/Conf/tools_def.template#L2299-L2300 [3] https://github.com/tianocore/edk2/commit/b12ef6b964f8fc0532432ebffd6774= 8648487133 Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c | 2 +- ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActio= nLib.c b/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib= .c index 2ca42c19c03f..f65463be96b0 100644 --- a/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c +++ b/ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c @@ -81,7 +81,7 @@ PeCoffLoaderRelocateImageExtraAction ( #ifdef __CC_ARM=0D #if (__ARMCC_VERSION < 500000)=0D // Print out the command for the RVD debugger to load symbols for this= image=0D - DEBUG ((EFI_D_LOAD | EFI_D_INFO, "load /a /ni /np %a &0x%p\n", DeCygwi= nPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)(Imag= eContext->ImageAddress + ImageContext->SizeOfHeaders)));=0D + DEBUG ((EFI_D_LOAD | EFI_D_INFO, "load /a /ni /np %a &0x%p\n", DeCygwi= nPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)Image= Context->ImageAddress));=0D #else=0D // Print out the command for the DS-5 to load symbols for this image=0D DEBUG ((EFI_D_LOAD | EFI_D_INFO, "add-symbol-file %a -o 0x%p\n", DeCyg= winPathIfNeeded (ImageContext->PdbPointer, Temp, sizeof (Temp)), (UINTN)Ima= geContext->ImageAddress));=0D diff --git a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib= .c b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c index 0b78554f6347..0a5e8db294ea 100644 --- a/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c +++ b/ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.c @@ -114,7 +114,7 @@ PeCoffLoaderRelocateImageExtraAction ( CHAR8 Buffer[256];=0D =0D #if (__ARMCC_VERSION < 500000)=0D - AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n",= ImageContext->PdbPointer, (UINTN)(ImageContext->ImageAddress + ImageContex= t->SizeOfHeaders));=0D + AsciiSPrint (Buffer, sizeof(Buffer), "load /a /ni /np \"%a\" &0x%08x\n",= ImageContext->PdbPointer, (UINTN)ImageContext->ImageAddress);=0D #else=0D AsciiSPrint (Buffer, sizeof(Buffer), "add-symbol-file %a -o 0x%08x\n", I= mageContext->PdbPointer, (UINTN)ImageContext->ImageAddress);=0D #endif=0D --=20 2.31.1