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?

Hi Chris,

You'll have to hack up the code generator, there is no user visible knob to turn off rip relative addressing.

-Chris

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.

Oh right, that could work.

-Chris