<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">The following links, runs, and returns an exit code of 15 for me on OSX:</div>
<br>
.data<br>
<div class="im">msg: .asciz "Hello, world!\n"<br>
.set len, . - msg<br>
<br>
</div>.text<br>
.globl _main<br>
_main:<br>
push $len<br>
pop %eax<br>
ret<span class="HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><div><br></div><div>Good to know. I copied this snippet to test.s and tried building on my Mac.</div><div><br></div><div><div>$ clang -c -o test.o -arch i386 test.s </div><div>$ ld -o test -macosx_version_min 10.6 -arch i386 test.o</div>
<div>Undefined symbols for architecture i386:</div><div> "start", referenced from:</div><div> -u command line option</div><div>ld: symbol(s) not found for architecture i386</div><div><br></div><div>So I rename _main to start, reassemble, and continue linking.</div>
<div><br></div><div>$ clang -c -o test.o -arch i386 test.s </div><div>$ ld -o test -macosx_version_min 10.6 -arch i386 test.o</div><div>ld: section __data (address=0x00002000, size=4294967307) would make the output executable exceed available address range for architecture i386</div>
</div><div><br></div><div>Eli, what are your build commands? Which versions of the developer tools are you using?</div><div><br></div><div>I finally managed to write a <a href="https://github.com/mcandre/mcandre/blob/master/gas/hello/freebsd/hello.s">hello.s</a> that builds and runs without problem, using as. clang refuses to assemble it.</div>
<br>-- <br><div></div>Cheers,<div><br></div><div>Andrew Pennebaker</div><div><a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a></div>