<html>
<head>
<base href="https://bugs.llvm.org/">
</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 appends ".1"/... to asm()-specified symbol names"
href="https://bugs.llvm.org/show_bug.cgi?id=45719">45719</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang appends ".1"/... to asm()-specified symbol names
</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>C
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>equinox-llvm@diac24.net
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>int testfn(void)
{
do {
extern int name_c1 asm("name_asm_a");
static __attribute__((used)) int *ptr = &name_c1;
static __attribute__((used)) int def_c asm("name_asm_a") =
0x1234;
} while (0);
do {
extern int name_c2 asm("name_asm_b");
static __attribute__((used)) int *ptr = &name_c2;
static __attribute__((used)) int def_c asm("name_asm_b") =
0x2345;
} while (0);
return 0;
}
compiles to (shortened):
testfn.ptr:
.quad name_asm_a
name_asm_a.1:
.long 4660 # 0x1234
testfn.ptr.2:
.quad name_asm_b
name_asm_b.3:
.long 9029 # 0x2345
- the "def_c" statements use assembler labels "name_asm_a.1" and "name_asm_b.3"
instead of expected "name_asm_a" and "name_asm_b".
- the initializer for "ptr" uses the asm name without the ".1" or ".3" suffix
This ultimately leads to the linker erroring out due to the symbols not
resolving correctly.
(The example above is extracted from a macro that is trying to create static
variables with cyclical pointers between two of them, hence the odd "extern"
declaration.)</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>