From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7229813320587987181==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: Re: MIPS and -msym32 Date: Fri, 01 Aug 2014 12:59:58 +0200 Message-ID: <20140801105957.GB28053@toonder.wildebeest.org> In-Reply-To: 53CE78E0.1050905@gmail.com --===============7229813320587987181== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Leonard, On Tue, Jul 22, 2014 at 05:44:48PM +0300, Crestez Dan Leonard wrote: > I used the elfutils mips patch from debian: > http://sources.debian.net/src/elfutils/0.159-4/debian/patches/mips_backe= nd.diff It would be convenient if the MIPS port was integrated upstream. Do you happen to know whether the porters might want to contribute it? The contribution policy for elfutils is documented at: https://git.fedorahosted.org/cgit/elfutils.git/tree/CONTRIBUTING > The generated dwarf files confuse systemtap is multiple ways. = Do you happen to have one such DWARF file around? I like to better understand which address size is set where. > Here is a hack I used to get around this: > --- a/libdw/dwarf_diecu.c > +++ b/libdw/dwarf_diecu.c > @@ -47,7 +47,22 @@ dwarf_diecu (die, result, address_sizep, offset_sizep) > *result =3D CUDIE (die->cu); > = > if (address_sizep !=3D NULL) > + { > *address_sizep =3D die->cu->address_size; > + /* Hack: */ > + if (1) > + { > + struct Elf *elf =3D die->cu->dbg->elf; > + GElf_Ehdr ehdr_mem; > + GElf_Ehdr* ehdr =3D gelf_getehdr (elf, &ehdr_mem); > + if (ehdr && > + ehdr->e_machine =3D=3D EM_MIPS && > + ehdr->e_ident[EI_CLASS] =3D=3D ELFCLASS64) > + { > + *address_sizep =3D 8; > + } > + } > + } > if (offset_sizep !=3D NULL) > *offset_sizep =3D die->cu->offset_size; > = > This is obviously evil. Yes, it is :) Assuming that address size used in the CU is correct, it seems the above check should be in systemtap instead. > Apparently the gcc folks decided that this -msym32 behavior was too > confusing and changed it to generate dwarf with a pointer size of 8: > https://gcc.gnu.org/ml/gcc/2009-01/msg00611.html Hmmm. That helps, but is technically wrong IMHO. It would be better to fix binutils instead. Thanks, Mark --===============7229813320587987181==--