<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/161550>161550</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
x86 Assembly: cannot use more than one symbol in memory operand
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chorman0773
</td>
</tr>
</table>
<pre>
Example code: https://godbolt.org/z/1TY9qrK3f
I am attempting to write a code sequence for getting the pc-relative offset on 32-bit x86. On GNU AS, it is correct to write `OFFSET foo-bar` (where `bar` is a symbol with a known offset - the result is emitting an `R_386_PC32` relocation, of which I can see no other way to coerce an assembler into generating). On llvm-mc and the llvm internal assembler (when used for inline assembly), you get the error "cannot use more than one symbol in memory operand", which is both a wierd diagnostic (given that its an OFFSET operand, not a memory operand) and an incompatibility with GNU AS, which makes the assembly language less expressive.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU0-vozYQ_zTmMkoE5oXAgUP6dlOtKnWr7vbQ02owA0zXePJsE1766SuTl76qPfWEwJ7fXwZD4NERterwgzp8yHCJk_jWTOJndPnxWGad9Lf24yvOF0tgpCdVnmCK8RJUeVL6rPR5lL4TG_fiR6XPfyp9Lr7-3rz4n8pB5SeVnz4BzoAx0nyJ7EaIAqvnSIAbIgR6WcgZgkE8jBTvlyaCi9l5shj5SiDDECiCOCj1ruMIr3W1h88Ofvz5Nzh9UfoZOAIHMOI9mfjOoqr88_n85eNXGER2HXpV5aB0vU7kt9O3TxwAIdzmTiysHCdA-O5kdQ_q3abJU1jsRkQz36WiSyi_fivr6tsvz6VOYJ6sGIwsLimTAdaJzQSfwKCDQAROQOJEHla8Ja1GyBtKWBgCzZ0lD-yiwEiOPCYipZvNsbXXeTcbQNdvktJ7ukveof3H-N2jgyVQv2XLzrKjx42b0k0Sd5Mlpb5BkfeSBrVB5ySmUZjFE8QJHYijR0DsYKZZ_A3kQh5dr7ROYHebHKCTLcGVyffQM45OQmSTRI18JZcQI3AMyfJbP39DPUMix_9QNJtndMDOyHzByB1bjrd7X-9_wl3FjN8pbLYejsGiGxccCSyFAPR68RQCX2mf9W3ZN2WDGbXF8dCUZV1VdTa1_RG7oquHYz90HZX1ESszkOkHbQ7aDJRxq3N9KPK8KI5Fkdf75liYBmtjOkPl0zCop5xmZLtPPaUtyTiEhdqiKg6HPLPYkQ3bCmrtaIXtNMV5-JD5diu7W8agnnLLIYZ3mMjRUvtaV3B6NFqe4H83ly3etv9aaY7T0u2NzEqfE9_bY3fx8geZqPR5UxnSst9tXFv9VwAAAP__uFV0YQ">