I've run into this problem in my current project, which requires reasoning about code at the binary level.
I think we can determine the starting location of all functions in a program by looking at the operand to CALL instructions. After we have this list, can we determine which function encloses an address by simply searching backward until we find a start address? IE is the start address of the function enclosing an instruction the greatest function address that is less than the instruction address?
If the above method is not correct, is there another way to find the starting address of the function enclosing an instruction?
edit: Added clarification of the question.
edit2: My method is probably wrong. Compilers are not guaranteed to place function bodies in contiguous regions of machine code.