On Thu, 26 Dec 2024 at 19:45, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > > > > Btw, does this actually happen when the compiler does the mcount thing for us? > > Yes. Ok, that's actually good. I'm not really worried about the "unused symbols aren't in kallsyms" issue, even if it confuses the mcount logic. THAT confusion is easy to deal with by either adding symbol size information (which I think would be a good thing in general, although perhaps not worth it). Even without the symbol size, the mcount issue can be dealt with by just knowing that the mcount location has to be at the very beginning of the function and just taking the offset - that we already do have - into account. I was more worried that there might also be some much deeper confusion with the linker actually garbage collecting the unused weak function code away, and now an unused symbol that kallsyms doesn't know about wouldn't just have an unexpected mcount pointer to it, but the mcount pointer would actually be stale and point to some unrelated code. So as long as *that* isn't what is happening, this all seems fairly benign. Linus