You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a BOLT Pass, I have to add some data in data section and create a Symbol which references the data. Then I will use the Symbol to generate some MCInst. I code it as bellow:
uint8_t *array = new uint8_t [1024];
auto &Section = BC.registerOrUpdateSection("MyData", ELF::SHT_PROGBITS, BinarySection::getFlags(false,false,true),array,1024);
array[0] = 1;//generate some data in the Section
Section.setOutputAddress(/*I don't know*/);
Section.setOutputFileOffset(/*"I don't know"*/);
int SymbolAddress;/*I don't know*/
BC.getOrCreateGlobalSymbol(SymbolAddress, "DATAAt",8);
However, the Symbol must be given a specific Address which is corresponding to the Section OutputAddress. However, the OutputAddress and OutputFileOffset is defined after all the BOLT PASSes, so I can't get the information inside my BOLT PASS, and I failed to define them by myself.
Is there any way to handle it?
The text was updated successfully, but these errors were encountered:
When writing a BOLT Pass, I have to add some data in data section and create a Symbol which references the data. Then I will use the Symbol to generate some MCInst. I code it as bellow:
However, the Symbol must be given a specific Address which is corresponding to the Section OutputAddress. However, the OutputAddress and OutputFileOffset is defined after all the BOLT PASSes, so I can't get the information inside my BOLT PASS, and I failed to define them by myself.
Is there any way to handle it?
The text was updated successfully, but these errors were encountered: