<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 9/23/2013 1:45 AM, Eli Friedman
wrote:<br>
</div>
<blockquote
cite="mid:CAJdarcFZd-P+pQXsQ_jwLbrY3LDHjiCHULN8c67ypRgx7ibXHQ@mail.gmail.com"
type="cite">
<div dir="ltr">On Sun, Sep 22, 2013 at 9:43 PM, Shankar Easwaran <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span>
wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div alink="#EE0000" bgcolor="#ffffff" link="#0B6CDA"
text="#000000" vlink="#551A8B"> Hi Eli,<br>
<br>
Slightly changed the example :-<br>
<br>
.section somedata<br>
.Ltmpa:<br>
.word 100<br>
.Ltmpb:<br>
.word 60<br>
.Ltmpc:<br>
.word 40<br>
.Ltmpd:<br>
.word (.Ltmpa-.Ltmpb)-.Ltmpc<br>
<br>
The GNU assembler properly handles the above.<br>
<br>
$as -c x.s -o x.o<br>
$readelf -x 4 x.o<br>
<br>
Hex dump of section 'somedata':<br>
NOTE: This section has relocations against it, but
these have NOT been applied to this dump.<br>
0x00000000 64003c00 28000000
d.<.(...<br>
<font
color="#ff0000">^^^^ (Calculated properly too!)</font><br>
With clang/llvm-mc <br>
<br>
$ llvm-mc -filetype=obj x.s -o x.o
<div class="im"><br>
LLVM ERROR: expected relocatable expression<br>
<br>
</div>
Looks like llvm-mc is more restrictive ?<br>
<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div>Emitting the relocation in question requires *negating*
the address of a variable. I could be wrong, but I'm
pretty sure there isn't any way to represent that in ELF.<br>
</div>
</div>
</div>
</div>
</blockquote>
Sorry for not setting context here. These variables are all local
variables, is there a need to create a relocation ?<br>
<br>
Thanks<br>
<br>
Shankar Easwaran<br>
<pre class="moz-signature" cols="72">--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
</body>
</html>