summaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-01-03 10:00:58 +0000
committerNick Clifton <nickc@redhat.com>2009-01-03 10:00:58 +0000
commit88ea709296cf6e9c3ee6c834e2c676d277817813 (patch)
tree94eac59ff09e301082d808606a2ace396a126212 /gprof
parentdc37402244728872ec27361ec6f2924733cda7e2 (diff)
downloadbinutils-redhat-88ea709296cf6e9c3ee6c834e2c676d277817813.tar.gz
PR 7099
* gprof.texi (Compiling): Mention the need for using -static-libgcc on shared library systems.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog6
-rw-r--r--gprof/gprof.texi14
2 files changed, 20 insertions, 0 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 1d1f5960c4..50b2ab23c6 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-03 Nick Clifton <nickc@redhat.com>
+
+ PR 7099
+ * gprof.texi (Compiling): Mention the need for using
+ -static-libgcc on shared library systems.
+
2009-01-02 Nick Clifton <nickc@redhat.com>
* po/id.po: Updated Indonesian translation.
diff --git a/gprof/gprof.texi b/gprof/gprof.texi
index f389087b7a..1f86383de7 100644
--- a/gprof/gprof.texi
+++ b/gprof/gprof.texi
@@ -325,6 +325,20 @@ example:
ld -o myprog /lib/gcrt0.o myprog.o utils.o -lc_p
@end example
+If you are running the program on a system which supports shared
+libraries you may run into problems with the profiling support code in
+a shared library being called before that library has been fully
+initialised. This is usually detected by the program encountering a
+segmentation fault as soon as it is run. The solution is to link
+against a static version of the library containing the profiling
+support code, which for @code{gcc} users can be done via the
+@samp{-static} or @samp{-static-libgcc} command line option. For
+example:
+
+@example
+gcc -g -pg -static-libgcc myprog.c utils.c -o myprog
+@end example
+
If you compile only some of the modules of the program with @samp{-pg}, you
can still profile the program, but you won't get complete information about
the modules that were compiled without @samp{-pg}. The only information