The starting address can be obtained from the function name, how to find the final address of the function? I was asked this question in an interview:
Consider the f () function that I wrote, crossed a text section and started writing a neighboring section (data section). How can I deal with this situation? He also added that I should process it using the C code. I should not see the symbol map file and get the address.
Using GCC, you can take the label address with an operator &&(yes - &&, not &).This can be used as follows:
&&
&
void f(void) { printf("Start %p End %p\n", f, &&f_end); f_end: return; }
, - , , .
C , , .
, .
.
, , " ", GetProcAddress, ( ), - , .
, , . , . , thunk.
, C "" .
What you could do is check your binary program and parse character tables, etc.
Perhaps your compiler can create a listing file, and your linker can create a map file. This will allow you to see how long a specific function is performed manually. Not sure if you need to determine the size from the C program itself.