How to iterate sections and process it?

Hi all,

Before emitting the object file, how and where can I iterate over each section containing symbols of type FUNC to perform some processing?
I believe the MC layer has this capability, but where exactly is it implemented?
I have looked through ELFObjectWriter.cpp and ELFStreamer.cpp, but I’m not sure where this can be achieved.

Normally, the contents of an ELF file is determined by the input data passed to the streamer; there isn’t a “post-processing” step.

If you just want to quickly hack something in, maybe try MCAssembler::layout.

1 Like

Thank you so much, this is exactly what I wanted.