------- Comment #4 from hailijuan at gmail dot com 2009-09-24 09:50 ------- There is another problem with "gcc -m64 -pg" since 4.4.0, seen from below:
# file /import/dr3/i386/gcc-4.4.0/lib/gcc/i386-pc-solaris2.11/4.4.0/amd64/gmon.o /import/dr3/i386/gcc-4.4.0/lib/gcc/i386-pc-solaris2.11/4.4.0/amd64/gmon.o: ELF 32-bit LSB relocatable 80386 Version 1 Seen from gcc building log, gcc didn't build gmon.o with m64 as expected. Since 4.4, gcc/config/i386/t-sol2 has been moved to libgcc/config/i386/t-sol2. However the flags for gmon.o turned to be empty. Any comments on the issue? Thanks, -- Lijuan (In reply to comment #3) > internal_mcount's from and self arguments were reversed from glibc's version. > Here's the full diff of gmon-sol2.c that produces correct output: > --- gcc/config/i386/gmon-sol2.c.orig Wed Jul 29 08:57:15 2009 > +++ gcc/config/i386/gmon-sol2.c Thu Jul 30 07:53:16 2009 > @@ -66,7 +66,7 @@ > extern void _mcleanup (void); > extern void internal_mcount ( > #ifdef __x86_64__ > - char *, unsigned short * > + unsigned short *, char * > #else > void > #endif > @@ -266,8 +266,8 @@ > "\tmovq\t%r9,0x30(%rsp)\n" > /* Get SELFPC (pushed by the call to this function) and > FROMPCINDEX (via the frame pointer. */ > - "\tmovq\t0x38(%rsp),%rdi\n" > - "\tmovq\t0x8(%rbp),%rsi\n" > + "\tmovq\t0x38(%rsp),%rsi\n" > + "\tmovq\t0x8(%rbp),%rdi\n" > "\tcallq\tinternal_mcount\n" > /* Restore the saved registers. */ > "\tmovq\t0x30(%rsp),%r9\n" > @@ -275,7 +275,7 @@ > "\tmovq\t0x20(%rsp),%rdi\n" > "\tmovq\t0x18(%rsp),%rsi\n" > "\tmovq\t0x10(%rsp),%rdx\n" > - "\tmovq\t0x08(%rsp),%rdx\n" > + "\tmovq\t0x08(%rsp),%rcx\n" > "\tmovq\t(%rsp),%rax\n" > "\taddq\t$0x38,%rsp\n" > "\tretq\n" > @@ -290,8 +290,8 @@ > void > internal_mcount ( > #ifdef __x86_64__ > - char *selfpc, > - unsigned short *frompcindex > + unsigned short *frompcindex, > + char *selfpc > #else > void > #endif > -- hailijuan at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hailijuan at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38085