On 09/20/2013 06:00 PM, Eli Friedman wrote:> On Fri, Sep 20, 2013 at 2:50 PM, Sid Manning <sidneym at codeaurora.org > <mailto:sidneym at codeaurora.org>> wrote: > > > This example generates the following error: > .Ltmp3: > .Ltmp5: > .Ltmp13: > .word (.Ltmp5-.Ltmp3)-.Ltmp13 > > ./llvm-mc ex.s -filetype=obj > LLVM ERROR: expected relocatable expression when using: > > > Umm, isn't this equivalent to the following? What do you expect LLVM to > do with it? > > .Ltmp13: > .word -.Ltmp13I removed the target specific assembly to produce a simple generic example. It was derived from eh_frame code the compiler was emitting. (.Ltmp5-.Ltmp3)+.Ltmp13 does not generate the error.> > -Eli-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
On Sun, Sep 22, 2013 at 12:23 PM, Sid Manning <sidneym at codeaurora.org>wrote:> On 09/20/2013 06:00 PM, Eli Friedman wrote: > >> On Fri, Sep 20, 2013 at 2:50 PM, Sid Manning <sidneym at codeaurora.org >> <mailto:sidneym at codeaurora.org**>> wrote: >> >> >> This example generates the following error: >> .Ltmp3: >> .Ltmp5: >> .Ltmp13: >> .word (.Ltmp5-.Ltmp3)-.Ltmp13 >> >> ./llvm-mc ex.s -filetype=obj >> LLVM ERROR: expected relocatable expression when using: >> >> >> Umm, isn't this equivalent to the following? What do you expect LLVM to >> do with it? >> >> .Ltmp13: >> .word -.Ltmp13 >> > > I removed the target specific assembly to produce a simple generic example.Then you must have reduced it too much; your example is simply invalid (although the compiler's error message isn't great). -Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130922/2c03a874/attachment.html>
Shankar Easwaran
2013-Sep-23 04:43 UTC
[LLVMdev] LLVM ERROR: expected relocatable expression
Hi Eli, Slightly changed the example :- .section somedata .Ltmpa: .word 100 .Ltmpb: .word 60 .Ltmpc: .word 40 .Ltmpd: .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 ? Thanks Shankar Easwaran -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130922/20edc76e/attachment.html>
Apparently Analagous Threads
- [LLVMdev] LLVM ERROR: expected relocatable expression
- [LLVMdev] LLVM ERROR: expected relocatable expression
- [LLVMdev] LLVM ERROR: expected relocatable expression
- [LLVMdev] LLVM ERROR: expected relocatable expression
- [LLVMdev] LLVM ERROR: expected relocatable expression