[LLVMbugs] [Bug 19764] relocation truncated to fit: R_X86_64_PC32 against symbol `environ' defined in COMMON section in /usr/lib/crt1.o

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 17 05:34:23 PDT 2014


Dimitry Andric <dimitry at andric.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |dimitry at andric.com
         Resolution|---                         |INVALID

--- Comment #1 from Dimitry Andric <dimitry at andric.com> ---
I do not think this is a problem in clang: the error happens for me with gcc
4.2 (in the FreeBSD base system) and the gcc 4.7 and gcc 4.8 ports too.

The problem is that you are creating three arrays of 100 million doubles, which
together take up 2.4 billion bytes in the text segment.  This is too large for
the medium memory model, which only supports up to 2GiB in the text segment.

The reason the error disappears if you use -O1 or higher, is that clang
optimizes away two of the arrays.  At -O0, the assembly has:

        .type   a, at object               # @a
        .local  a
        .comm   a,800000000,16
        .type   b, at object               # @b
        .local  b
        .comm   b,800000000,16
        .type   c, at object               # @c
        .local  c
        .comm   c,800000000,16

At -O1, this becomes just:

        .type   a, at object               # @a
        .local  a
        .comm   a,800000000,16

and then the text segment does not become too big.  I tried gcc 4.2, 4.7 and
4.8 with -O1 through -O3, but no combination seems to be able to optimize away
the b and c arrays, and none of the resulting object files could be linked into
an executable.

If you cannot get the original program to link using -mcmodel=large, please
re-open this bug.  Otherwise, file a FreeBSD PR against the benchmarks/stream

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140517/8be8642a/attachment.html>

More information about the llvm-bugs mailing list