[cfe-dev] GNU assembler syntax for strlen

Andrew Pennebaker andrew.pennebaker at gmail.com
Tue Oct 16 11:14:12 PDT 2012


> msg: .asciz "Hello, world!\n"
> .set len, . - msg
>
> foo:
>         push $len
>

That's odd, on my system this syntax fails to link.

$ clang -c -o hello.o -arch i386 hello.s
$ ld -o hello -macosx_version_min 10.6 -arch i386 hello.o
$ ld: section __data (address=0x00002000, size=4294967279) would make the
output executable exceed available address range for architecture i386

Joerg, could you post a full hello.s file?

What are your system specs? Mine are:

$ ld -v
@(#)PROGRAM:ld  PROJECT:ld64-134.9
configured to support archs: armv6 armv7 armv7s i386 x86_64
LTO support using: LLVM version 3.1svn, from Apple Clang 4.1 (build
421.11.65)
$ clang --version
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.2.0
Thread model: posix
$ xcodebuild -version
Xcode 4.5.1
Build version 4G1004
$ system_profiler SPSoftwareDataType | grep System
    System Software Overview:
      System Version: OS X 10.8.2 (12C54)

-- 
Cheers,

Andrew Pennebaker
www.yellosoft.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121016/8f4c97ad/attachment.html>


More information about the cfe-dev mailing list