From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18056 invoked by alias); 3 Feb 2011 18:59:36 -0000 Received: (qmail 18049 invoked by uid 22791); 3 Feb 2011 18:59:36 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Feb 2011 18:59:28 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p13IxRbH027266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Feb 2011 13:59:27 -0500 Received: from patootie.office.frob.com ([10.3.113.7]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p13IxR0Y030349; Thu, 3 Feb 2011 13:59:27 -0500 Received: from magilla.sf.frob.com (magilla.office.frob.com [198.49.250.228]) by patootie.office.frob.com (Postfix) with ESMTP id 50CFF47ED; Thu, 3 Feb 2011 10:59:26 -0800 (PST) Received: by magilla.sf.frob.com (Postfix, from userid 5281) id 19226180954; Thu, 3 Feb 2011 10:59:26 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Mark Wielaard Cc: systemtap@sourceware.org Subject: Re: Failures with exelib.exp testcase (was Re: minutes 2010-08-19) In-Reply-To: Mark Wielaard's message of Thursday, 3 February 2011 13:44:37 +0100 <1296737077.3341.22.camel@springer.wildebeest.org> References: <20110119120045.GA2431@in.ibm.com> <1898521794.32834.1295479440812.JavaMail.root@zmail01.collab.prod.int.phx2.redhat.com> <20110120011852.1C1041822E9@magilla.sf.frob.com> <1295521862.4118.5.camel@springer.wildebeest.org> <20110120185339.6FF851807D2@magilla.sf.frob.com> <1295651779.3049.15.camel@springer.wildebeest.org> <20110202121440.GB3524@in.ibm.com> <1296651551.4270.34.camel@springer.wildebeest.org> <20110203050358.GA2488@in.ibm.com> <1296728173.3341.7.camel@springer.wildebeest.org> <20110203123353.GC2488@in.ibm.com> <1296737077.3341.22.camel@springer.wildebeest.org> Message-Id: <20110203185926.19226180954@magilla.sf.frob.com> Date: Thu, 03 Feb 2011 18:59:00 -0000 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00203.txt.bz2 > > > So, I see it doesn't even compile. Which must mean the #ifdef > > > __powerpc__ is the wrong guard. What should be tested for to see whether > > > we are compiling on powerpc? That is not the right thing to test anyway. Firstly, don't assume the translator host is the same as the target at all. We do support cross compilation. Second, even on powerpc, you can't assume that the target is always 64-bit. 32-bit powerpc does not need this indirection. The right is a runtime test of the translator's record of what machine this module is built for. > > > + sym_addr = *((Dwarf_Addr *) sym_addr); > > Have to ponder why that is too naive. Anybody with some powerpc elf .odp > section knowledge see immediately why? There is nothing target-specific about why that's wrong. It's just generic fuzzy thinking, sorry. This address is in the target module, not in the translator's own address space. What you need to do is: Elf64_Addr opd_addr; Dwarf_Addr bias; Elf_Scn *opd = dwfl_module_address_section (mod, &sym_addr, &bias); if (opd == NULL) ...; Elf_Data *data = elf_rawdata (opd, NULL); if (data == NULL) ...; Elf_Data in, out; out.d_buf = &final_addr; in.d_buf = (char *) data->d_buf + sym_addr; out.d_size = in.d_size = sizeof (Elf64_Addr); out.d_type = in.d_type = ELF_T_ADDR; if (elf64_xlatetom (elf, &out, &in, e_ident[EI_DATA]) == NULL) ...; sym_addr = opd_addr + bias; Thanks, Roland