Chris Stavrakakis
2011-May-16 13:24 UTC
[LLVMdev] External constants and RIP relative addressing
Hi all, in llvm-2.8, i declare an external constant of i64 and i want the instructions that use the value of this constant to use absolute addressing instead of RIP relative, that is: I get: "48 8b 35 00 00 00 00 mov 0x0(%rip),%rsi" #AT&T syntax But i would prefer: "48 BE 00 00 00 00 00 00 mov 0x0, %rsi" The reason i want this is that i use a specific loader that expects absolute addressing for patching constants. Is there any way to achieve this?
Chris Lattner
2011-May-16 15:46 UTC
[LLVMdev] External constants and RIP relative addressing
On May 16, 2011, at 6:24 AM, Chris Stavrakakis wrote:> Hi all, > > in llvm-2.8, i declare an external constant of i64 and i want the > instructions that use the value of this constant to use absolute > addressing instead of RIP relative, that is: > > I get: "48 8b 35 00 00 00 00 mov 0x0(%rip),%rsi" #AT&T syntax > But i would prefer: "48 BE 00 00 00 00 00 00 mov 0x0, %rsi" > > The reason i want this is that i use a specific loader that expects > absolute addressing for patching constants. > > Is there any way to achieve this?Hi Chris, You'll have to hack up the code generator, there is no user visible knob to turn off rip relative addressing. -Chris
Anton Korobeynikov
2011-May-17 13:25 UTC
[LLVMdev] External constants and RIP relative addressing
Chris,> You'll have to hack up the code generator, there is no user visible knob to turn off rip relative addressing.Why? One can use medium code model which does not do any rip-rel stuff. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Apparently Analagous Threads
- [LLVMdev] External constants and RIP relative addressing
- [LLVMdev] External constants and RIP relative addressing
- [LLVMdev] External constants and RIP relative addressing
- [LLVMdev] "make check" failures: leaq in fold-mul-lohi.ll, stride-nine-with-base-reg.ll, stride-reuse.ll
- [LLVMdev] "make check" failures: leaq in fold-mul-lohi.ll, stride-nine-with-base-reg.ll, stride-reuse.ll