This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
linking after -freorder-blocks-and-partition was used
- From: Kristis Makris <kristis dot makris at asu dot edu>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Apr 2007 15:43:18 -0700
- Subject: linking after -freorder-blocks-and-partition was used
Hello,
I'm having a hard time getting -freorder-blocks-and-partition to work as
expected.
This optimization flag, used with __builtin_expect() to provide branch
prediction hints, produces an object file that groups uncommon code
blocks in a separate section called ".text.unlikely". However, when I
further link the object file with other object files I get an executable
that is missing the ".text.unlikely" section.
I am first running with -fprofile-generate, then running the executable,
and then recompiling with -fprofile-use. I see the ".text.unlikely"
section in an intermediate object file, but not in the final executable.
Is this a bug ? I tested with gcc4.1.1/ld2.17.
Thanks for any help.
Kristis