[llvm-dev] Backend Plugins?
via llvm-dev
llvm-dev at lists.llvm.org
Thu May 17 15:01:25 PDT 2018
Kenneth Adam Miller wrote:
> By address, I mean the selected location in the binary. I need the
> ground truth for other static analyses.
That's not determined until instructions are encoded for the object
file, which is pretty deep down in MC. I can imagine a couple of ways
to get the info you want, but it's not pretty. You could emit a label
for every instruction, and then work out the label offsets later on;
you might also be able to collect section offsets as the encoded
instructions are emitted to the object file.
But really, it seems easier to do a disassembly on the object file,
instead of trying to collect the information during compilation.
--paulr
More information about the llvm-dev
mailing list