<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);"></pre>Hi Rafael<div><br></div><div>I don’t know if you are expecting this, but this commit breaks the old x86_64 OS X systems (10.5 and below) which need __eh_frame. It will failed to compile any programs for old OS X (with “-mmacosx-version-min” flag). I attached two simple test cases which give slightly different error messages:</div><div><br></div><div>$ clang -arch x86_64 -Os -mmacosx-version-min=10.4 test_case.c -o test.o<br>ld: sectionForAddress(0xFFFFFFFFFF91969F) address not in any section file '/var/folders/cg/pyj86ks15y74w3hkwhm_zltm0000gp/T/test_case-cd1eb6.o' for architecture x86_64<br>clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)</div><div>$ clang -arch x86_64 -Os -mmacosx-version-min=10.4 test_case2.c -o test<br>ld: symbol index out of range file '/var/folders/cg/pyj86ks15y74w3hkwhm_zltm0000gp/T/test_case2-9a07c6.o' for architecture x86_64<br>clang-3.5: error: linker command failed with exit code 1 (use -v to see invocation)</div><div><br></div><div>The reason of the failure is that the OS X linker cannot recognize the generated relocations in __eh_frame. The current clang will create relocation section looks like:</div><div>Relocation information (__TEXT,__eh_frame) 4 entries<br>address  pcrel length extern type    scattered symbolnum/value<br>00000048 False quad   False  SUB     False     2 (__TEXT,__eh_frame)<br>00000048 False quad   True   UNSIGND False     _main<br>00000020 False quad   False  SUB     False     2 (__TEXT,__eh_frame)<br>00000020 False quad   True   UNSIGND False     _foo</div><div>But the linker is expecting either a pair of SUB/UNSIGNED relocations in eh_frame (for old systems) or no relocations (for new systems). A fix might just be remove all the relocations in eh_frame. I CCed Nick in this thread, so Nick correct me if I am wrong.</div><div><br></div><div>Thanks</div><div><br></div><div>Steven</div><div><br></div><div></div></body></html>