http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52795
--- Comment #1 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-03-30 19:40:43 UTC --- Created attachment 27048 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27048 testcase from radar://10960042 generated on x86_64-apple-darwin11 ( The FSF gcc testsuite failure... FAIL: gcc.dg/tree-prof/pr34999.c compilation, -fprofile-use -D_PROFILE_USE UNRESOLVED: gcc.dg/tree-prof/pr34999.c execution, -fprofile-use -D_PROFILE_USE seen at -m64 with Xcode 4.3's linker may be showing a linker bug. The attached testcase contains the files obtained with... /sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/ /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120228/gcc/testsuite/gcc.dg/tree-prof/pr34999.c -O2 -freorder-blocks-and-partition -fprofile-generate -D_PROFILE_GENERATE -lm -m64 -o pr34999.x01 Executing the resulting pr34999.x01 to produce the profiling code in pr34999.gcda (provided) and... /sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/xgcc -B/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/ /sw/src/fink.build/gcc47-4.7.0-1/gcc-4.7-20120228/gcc/testsuite/gcc.dg/tree-prof/pr34999.c -O2 -freorder-blocks-and-partition -fprofile-use -D_PROFILE_USE -lm -m64 --save-temps -v -o pr34999.x02 which produces the linker error... Assertion failed: (cfiStartsArray[i] != cfiStartsArray[i-1]), function parse, file /SourceCache/ld64/ld64-128.2/src/ld/parsers/macho_relocatable_file.cpp, line 1519. 0 0x10c62d1df __assert_rtn + 79 1 0x10c648ae5 mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 917 2 0x10c63632e mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, unsigned int, mach_o::relocatable::ParserOptions const&) + 286 3 0x10c632b2b mach_o::relocatable::parse(unsigned char const*, unsigned long long, char const*, long, unsigned int, mach_o::relocatable::ParserOptions const&) + 91 4 0x10c66b6fd ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 653 5 0x10c66ccfb ld::tool::InputFiles::InputFiles(Options&, char const**) + 651 6 0x10c62d426 main + 358 which can be reproduced with the provided bad_link shell script which executes... ld -dynamic -arch x86_64 -macosx_version_min 10.7.3 -weak_reference_mismatches non-weak -o pr34999.x02 -lcrt1.10.6.o -L. pr34999.o -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lSystem -v