<html>
<head>
<base href="https://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 --- - clang does not pass '-r' to linker in some cases." href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23688&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=P0mDkEHYPBzuRw5aECik3TZmlqckpUuX3KRVItNbkSM&s=O5vr8EBbzqa4QNRAV-O6kworAEjjt6K5qvt7agKpKmg&e=">23688</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang does not pass '-r' to linker in some cases.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>yunlian@chromium.org
</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>cat f.c
int foo(){
return 1;
}
clang -c f.c -o f.o
clang -nostdlib -r f.o -o b.o
clang-3.7: warning: argument unused during compilation: '-r'
/usr/x86_64-pc-linux-gnu/binutils-bin/2.24/ld.bfd.real: warning: cannot find
entry symbol _start; defaulting to 00000000004000f0
readelf b.o -h
Type: EXEC (Executable file)
If I run
gcc -nostdlib -r f.o -o b.o
If does not show such warning message and the elf type is
Type: REL (Relocatable file)
So the '-r' is supposed to pass to the linker instead of clang itself.</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>