Re: "File has no CTF section."

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Arnaldo,

Thanks for the quick reply!

On Tue, Mar 25, 2008 at 01:41:03PM -0300, Arnaldo Carvalho de Melo wrote:
> > I have three object files: one is 'dwarves.o' from the pahole
> > distribution, compiled with 'gcc -g'.  Another is 'foobar.o' from my
> > own embedded application, compiled with the same compiler, on the same
> > box [1].  The third object file is 'foobar.o' compiled with some
> > version of compiler (Metrowerks?) for the embedded platform that we use.
> > 
> > If I use 'objdump -W' on all three files, I get heaps of information,
> > including the structure definitions and other stuff.  Good.
> 
> can you try with:
> 
> # binutils
> readelf -w i build/pahole
> 
> # elfutils
> eu-readelf -w i build/pahole

Yup.  I get the same (or very similar) information.

> > The most puzzling thing is that two object files, compiled with the
> > same compiler on the same machine have different enough DWARF data
> > that one works with pahole and one doesn't.
> > 
> > What can I do to follow through with this?  Contact the elfutils
> > maintainers?
> 
> Possibly, but can you make these two object files available somewhere?
> I'd like to take a look...

See the attached file.  If you just compile it with 'gcc -g -c hello.c',
pahole works fine on the resulting object file.  If at line 17 you change
'#if 0' to '#if 1', pahole will complain about the lack of CTF (sorry,
I didn't have time to pull your updates).

Cheers,
florin

-- 
Bruce Schneier expects the Spanish Inquisition.
      http://geekz.co.uk/schneierfacts/fact/163
#include <stdio.h>

struct foo
{
   int i;
   char c;
   float f;
};

struct bar
{
   struct foo f;
   char c;
   int i;
};

#if 0
#pragma BSS(".do_not_init")
struct foo f;
#pragma BSS(DEFAULT_SECTION_BSS)
#endif

int main(void)
{
   struct bar b;

   printf("Hello, struct bar(%u)!\n", sizeof(b));

   return 0;
}

Attachment: pgpMh4FGn2jS1.pgp
Description: PGP signature


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux