How to use MCSymbol to obtain the offset address of the basic block in the object file?

Maybe my question is a bit stupid, but this is indeed a difficult problem for me. I hope someone can help me answer this question, thanks in advance.

My ultimate goal is to obtain the offset address of each basic block in the object file, and then relocate to the corresponding absolute address after linking to generate the executable file.

At present, I have obtained the MCSymbol of each basic block of the MC layer through llvm pass.


I hope to obtain the corresponding basic block address by looking up the MCSymbol in the object file. Can anyone tell me if this is possible, and if it is possible, what should I do next? Or am I doing something wrong from the beginning?