3 ms·
As others said, you can't really do it without disassembling the function (bonus problem: the general case is undecidable). A solution is to have your linker in
by emillon 13y ago
As others said, you can't really do it without disassembling the function (bonus problem: the general case is undecidable). A solution is to have your linker insert a "end of function" symbol in the ELF object (using a linker script), and import it in your C code a pointer. Then the size of f is "f_end - (void\*) f".