This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Failures with exelib.exp testcase (was Re: minutes 2010-08-19)


On Mon, 2011-02-14 at 22:19 +0530, K.Prasad wrote:
> On Tue, Feb 08, 2011 at 02:13:35PM +0100, Mark Wielaard wrote:
> > On Thu, 2011-02-03 at 10:59 -0800, Roland McGrath wrote:
> > > 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 for the pseudocode example. Prasad, is that enough for you to
> > take a stab at hacking up a solution for the powerpc symbol lookup
> > issue?
> >
> So basically this would turn out into a piece of code to derive symbol
> address in, say dump_unwindsyms() in translate.cxx specific to
> __powerpc__ (or so I understand)?

Yes. The check should probably depend on whether the elf header has 
e_machine == EM_PPC64 (since you could be running on ppc64, but
introspecting a ppc32 binary, which doesn't need these fixups).

> I'll give this a try and report what happens.

Thanks,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]