[PATCH] D15635: AsmPrinter: Produce PC-relative cstexprs when possible.

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 20 08:00:23 PST 2016


rafael added a comment.

It seems odd to do this at the asm *printer*

Currently the ELF testcase prints

.long	.Lbar-foo
	.long	.Lbar-foo

And with gas that produces R_X86_64_PC32. In contrast MC produces an error:

Cannot represent a subtraction with a weak symbol.

One of the many horrible things about the .s format is that there is no way to differentiate "this symbol foo" versus "whatever symbol foo resolves to". MC Is trying the second one and failing. Gas is using the first one and finding a relocation that works.

I will take a quick look to see what the change would be like for MC to behave like gas on this one.

Is it possible that a similar issue is impacting MachO?


http://reviews.llvm.org/D15635





More information about the llvm-commits mailing list