[LLVMdev] LLVM ERROR: expected relocatable expression
eli.friedman at gmail.com
Sun Sep 22 23:45:07 PDT 2013
On Sun, Sep 22, 2013 at 9:43 PM, Shankar Easwaran
<shankare at codeaurora.org>wrote:
> Hi Eli,
> Slightly changed the example :-
> .section somedata
> .word 100
> .word 60
> .word 40
> .word (.Ltmpa-.Ltmpb)-.Ltmpc
> The GNU assembler properly handles the above.
> $as -c x.s -o x.o
> $readelf -x 4 x.o
> Hex dump of section 'somedata':
> NOTE: This section has relocations against it, but these have NOT been
> applied to this dump.
> 0x00000000 64003c00 28000000 d.<.(...
> ^^^^ (Calculated
> properly too!)
> With clang/llvm-mc
> $ llvm-mc -filetype=obj x.s -o x.o
> LLVM ERROR: expected relocatable expression
> Looks like llvm-mc is more restrictive ?
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev