Summary: | executable causes SIGFPE whenever linking against libc_p | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Seong-Kook Shin <tanarrian> |
Component: | [OLD] Development | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED DUPLICATE | ||
Severity: | major | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Seong-Kook Shin
2008-09-02 23:28:57 UTC
Are you sure -lc_p is needed in this case? I thought -pg was sufficient when linking with gcc, and -lc_p is only explicitly passed when linking via ld http://sourceware.org/binutils/docs/gprof/Compiling.html # use static linking because glibc with profiling is libc_p.a gcc -pg nop.c -static ./a.out gprof -q -b Call graph granularity: each sample hit covers 2 byte(s) no time propagated index % time self children called name 0.00 0.00 1/1 __libc_start_main [817] [1] 0.0 0.00 0.00 1 main [1] ----------------------------------------------- Index by function name [1] main wormo: from further in the gprof documentation: "If you run the linker ld directly ... In addition, you would probably want to specify the profiling C library, libc_p.a, by writing `-lc_p' instead of the usual `-lc'. This is not absolutely necessary, but doing this gives you number-of-calls information for standard library functions such as read and open. For example: " AFAIK, if you want to use c_p to profile libc, you have to use ld manually, Spanky might be able to comment better however. (In reply to comment #2) > # use static linking because glibc with profiling is libc_p.a > gcc -pg nop.c -static > ./a.out > gprof -q -b Call graph > > > granularity: each sample hit covers 2 byte(s) no time propagated > > index % time self children called name > 0.00 0.00 1/1 __libc_start_main [817] > [1] 0.0 0.00 0.00 1 main [1] > ----------------------------------------------- > > Index by function name > > [1] main > If I tried on my machine, I got SIGSEGV instead of SIGFPE. Don't know why. (The configuration of my machine is already posted here) $ gcc -static nop.c -lc_p $ ./a.out Segmentation fault $ gdb -q a.out (no debugging symbols found) Using host libthread_db library "/lib/libthread_db.so.1". (gdb) r Starting program: /home/cinsk/Documents/pesticide/a.out (no debugging symbols found) Program received signal SIGSEGV, Segmentation fault. 0x0806e27b in __mcount_internal () (gdb) bt #0 0x0806e27b in __mcount_internal () #1 0x00000000 in ?? () (gdb) *** This bug has been marked as a duplicate of bug 201376 *** |