GENERIC_RELOC_SECTDIFF missing following pair for architecture i386

Originator:dmaclach
Number:rdar://10810415 Date Originated:2012/02/05
Status:OPEN Resolved:
Product:Developer Tools Product Version:4.2 (4c199)
Classification:Serious Bug Reproducible:Always
 
05-Feb-2012 10:29 AM David MacLachlan:
Summary:
I am attempting to profile (as in gcov style profiling) my unit tests for an Xcode 4.2 project on Snow Leopard (10.6) linking against iOS 5.0. I have turned on -fprofile-arcs -ftest-coverage and I'm linking against -lprofile_rt. Compiling with LLVM 3.0.

My target is a static library that is being tested by a unit test bundle.

Everything compiles fine, but in the link step for the unit test bundle I get:

ld: in Foo/DerivedData/Foo/Build/Intermediates/Foo.build/Debug Profile-iphonesimulator/UnitTests.build/Objects-normal/i386/TestUtilities.o, in section _DATA,_const reloc 0: GENERIC_RELOC_SECTDIFF missing following pair for architecture i386

This is the actual link step:

setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin" /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -bundle -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk "-LFoo/Build/Products/Debug Profile-iphonesimulator" -L/Developer/usr/lib "-FFoo/Build/Products/Debug Profile-iphonesimulator" -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -filelist "Foo/DerivedData/Foo/Build/Intermediates/Foo.build/Debug Profile-iphonesimulator/UnitTests.build/Objects-normal/i386/UnitTests.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fprofile-arcs -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -lFoo -framework Foundation -framework SenTestingKit -lprofile_rt -o "Foo/DerivedData/Foo/Build/Products/Debug Profile-iphonesimulator/UnitTests.octest/UnitTests"

Steps to Reproduce:

1) Attempt to build for testing the attached project

Expected Results:

1) Link and unittests run

Actual Results:

in section _DATA,_const reloc 0: GENERIC_RELOC_SECTDIFF missing following pair for architecture i386

Regression:

It appears if you simplify the file (i.e. remove several of the STTest statements) it will link and compile. My theory is that it has to do with the number of @exception blocks generated by the macro. I did run into this in the field.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!