On Sun, 2 Dec 2001, Nadav Har'El wrote: > On Sun, Dec 02, 2001, Shlomi Fish wrote about "Problems when linking against the >profiled libc": > > > > When invoking the following command: > > > > gcc -Wall -o mptest -L. test_multi_parallel.o -lfcs -lm -pg -lc_p > > > > I get the following error: > > > > gcc -Wall -o mptest -L. test_multi_parallel.o -lfcs -lm -pg -lc_p > > /usr/bin/ld-real: /lib/ld-linux.so.2: indirect symbol > >... > > I saw an error similar to this on my Redhat 7.2. Apparently the > glibc-profile-2.2.4-19 only contains a non-shared library (/usr/lib/libc_p.a) > and for some reason -lc_p works, but incorrectly, when ld is looking for > shared libraries (I never bothered to look for why this error is happening - > you might want to report it to Redhat's bugzilla). > > Anyway, adding "-static" to the linking line fixed the problem (it also > generated a huge static executable, but that shouldn't be a problem for an > executable that was only meant for profiling). >
Thanks, it worked. Regards, Shlomi Fish > > I checked that the problem persists with the command: > > gcc test.c -pg -lc_p > > By the way, when profiling, you should also use "-g". Without debugging > information, some of the information gprof gives you (namely, in which file > each routine lives) will be wrong - and this is especially annoying when > you're profiling something with "static" functions (where a function by the > same name can come from several files). > > -- > Nadav Har'El | Sunday, Dec 2 2001, 17 Kislev 5762 > [EMAIL PROTECTED] |----------------------------------------- > Phone: +972-53-245868, ICQ 13349191 |A Nobel Peace Prize? I would KILL for one > http://nadav.harel.org.il |of those. > ---------------------------------------------------------------------- Shlomi Fish [EMAIL PROTECTED] Home Page: http://t2.technion.ac.il/~shlomif/ Home E-mail: [EMAIL PROTECTED] If: 1. A is A 2. A is not not-A does it imply that 1. B is B 2. B is not not-B ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]