I’m using llvm 8 , and I want to know , How to place a variable / function at a given absolute address in memory.
Placing a variable / function at a specific address requires the cooperation of the linker and depending on where you are running the program, the OS. The following stack-overflow question, although relating to GCC, it also can be applied to LLVM https://stackoverflow.com/questions/4067811/how-to-place-a-variable-at-a-given-absolute-address-in-memory-with-gcc
Essentially you need to compile the variable or function in a named section and then place the named section using a linker script, all assuming the linker you are using can support that.
Hope that helps
LLVM Developers mailing list