http://llvm.org/bugs/show_bug.cgi?id=19764

            Bug ID: 19764
           Summary: relocation truncated to fit: R_X86_64_PC32 against
                    symbol `environ' defined in COMMON section in
                    /usr/lib/crt1.o
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 12519
  --> http://llvm.org/bugs/attachment.cgi?id=12519&action=edit
minimal example to illustrate the issue

Hi there,

in an attempt to compile
http://blogs.utexas.edu/jdm4372/2013/01/17/stream-version-5-10-released/ with
clang 3.4 on a FreeBSD 10.0-stable system, the linker fails when using large
arrays and using mcodel=medium. gcc47 and higher compile and link the same
program just fine.

I've attached a minimal example "big_array.c" that fails to link when using -O0
but works with -O1 and higher.

$ clang -O0 -mcmodel=medium big_array.c -o big_array
/usr/lib/crt1.o: In function `_start':
/usr/src/lib/csu/amd64/crt1.c:(.text+0x1f): relocation truncated to fit:
R_X86_64_PC32 against symbol `environ' defined in COMMON section in
/usr/lib/crt1.o
/usr/src/lib/csu/amd64/crt1.c:(.text+0x29): relocation truncated to fit:
R_X86_64_PC32 against symbol `environ' defined in COMMON section in
/usr/lib/crt1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks & cheerio, Harry.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to