<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - relocation truncated to fit: R_X86_64_PC32 against symbol `environ' defined in COMMON section in /usr/lib/crt1.o"
href="http://llvm.org/bugs/show_bug.cgi?id=19764">19764</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>relocation truncated to fit: R_X86_64_PC32 against symbol `environ' defined in COMMON section in /usr/lib/crt1.o
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>harry.weppner@gmx.net
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=12519" name="attach_12519" title="minimal example to illustrate the issue">attachment 12519</a> <a href="attachment.cgi?id=12519&action=edit" title="minimal example to illustrate the issue">[details]</a></span>
minimal example to illustrate the issue
Hi there,
in an attempt to compile
<a href="http://blogs.utexas.edu/jdm4372/2013/01/17/stream-version-5-10-released/">http://blogs.utexas.edu/jdm4372/2013/01/17/stream-version-5-10-released/</a> 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>