Currently in gcc trunk on darwin10, we fail the test cases... FAIL: g++.dg/tree-prof/partition1.C compilation, -g -fprofile-use UNRESOLVED: g++.dg/tree-prof/partition1.C execution, -g -fprofile-use FAIL: g++.dg/tree-prof/partition1.C compilation, -O3 -g -fprofile-use UNRESOLVED: g++.dg/tree-prof/partition1.C execution, -O3 -g -fprofile-use when compiling with -freorder-blocks-and-partition on darwin10 because of many warnings of the form... ld: warning: can't add line info to anonymous symbol anon-func-0xF40 from /var/tmp//ccrw73YL.o This was filed as radar 7289379 with the two failing test cases provided as samples of the problem. Apple's response was... "In the sample you supplied, the warning is because there is code in the __TEXT/__unlikely section and there is dwarf debug information that says it part of a function. The linker sanity checks how it broke up the .o file into "atoms" by checking it against the dwarf debug info. I think the __unlikely section should be avoided on darwin until it is shown to work with the linker. At a minimum each chunk in the __unlikely section should have a label on it with a name based on the function it came from. Those labels would also help debugging. This warning does not have anything to do removing labels from __eh_frame section."
Basically I think breaking up functions inside sections/segments in object files is a broken way of doing dead stripping.
(In reply to comment #1) > Basically I think breaking up functions inside sections/segments in object > files is a broken way of doing dead stripping. hmm I think this is related to hot/cold partitioning rather than dead code stripping, per se. I wonder if it's partial fallout from not being able to use dwarf >2. ( I seem to recall that the problem area in dwarf2out was around the hot/cold sections).
Created attachment 21755 [details] patch to prune bogus linker warnings from Xcode 3.2.x.
Subject: Bug 42070 Author: bonzini Date: Tue Sep 14 07:40:44 2010 New Revision: 164269 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164269 Log: 2010-09-10 Jack Howarth <howarth@bromo.med.uc.edu> PR target/42070 * gcc/testsuite/lib/profopt.exp: Prune warnings on execname2 compile. * gcc/testsuite/lib/prune.exp: Prune "can't add line info" warnings. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/lib/profopt.exp trunk/gcc/testsuite/lib/prune.exp
Fixed.
Author: mrs Date: Wed Oct 6 19:22:37 2010 New Revision: 165063 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=165063 Log: 2010-10-06 Jack Howarth <howarth@bromo.med.uc.edu> Backport from mainline 2010-09-10 Jack Howarth <howarth@bromo.med.uc.edu> PR target/42070 * lib/profopt.exp: Prune warnings on execname2 compile. * lib/prune.exp: Prune "can't add line info" warnings. Modified: branches/gcc-4_5-branch/gcc/testsuite/ChangeLog branches/gcc-4_5-branch/gcc/testsuite/lib/profopt.exp branches/gcc-4_5-branch/gcc/testsuite/lib/prune.exp