[Ltrace-devel] [PATCH] On ppc64 arch, arch_translate_address will only need indirect read if address is located in the .plt segment. This patch ensure address is part of that segment, otherwise it just returns the address.

thierry at linux.vnet.ibm.com thierry at linux.vnet.ibm.com
Tue Apr 5 07:25:44 UTC 2016


From: Thierry Fauck <tfauck at free.fr>

        modified:   sysdeps/linux-gnu/ppc/plt.c

Signed-off-by: Thierry Fauck <tfauck at free.fr>

	modified:   sysdeps/linux-gnu/ppc/plt.c
---
 sysdeps/linux-gnu/ppc/plt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index 2238e4e..8ddeae7 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -325,7 +325,10 @@ arch_translate_address(struct ltelf *lte,
 		       arch_addr_t addr, arch_addr_t *ret)
 {
 	if (lte->ehdr.e_machine == EM_PPC64
-	    && !lte->arch.elfv2_abi) {
+	    && !lte->arch.elfv2_abi
+	    && ((arch_addr_t)(uintptr_t)lte->arch.opd_base <= addr
+		&& addr < (arch_addr_t)(uintptr_t)
+			(lte->arch.opd_base+lte->arch.opd_size))) {
 		/* XXX The double cast should be removed when
 		 * arch_addr_t becomes integral type.  */
 		GElf_Xword offset
-- 
1.8.3.1




More information about the Ltrace-devel mailing list