symless
symless copied to clipboard
Remove propagation dependence to calling convention
Right now the information forwarded during a function call depend on the callee's calling convention: Only the register / stack parameters are forwarded to callee.
Current approach problems
- The binary possible calling conventions have to be guessed depending on the binary arch, only a few cc are supported;
- A lot of messy code is used to guess a function calling convention.
The only advantage of knowing a function's cc is that it can be used to know if it is worth to propagate in a callee, by looking if any interesting info is present in its parameters. For performance sake this is required, but could be avoided by improving how the propagation is done.
How to improve
Do not consider callee's cc when propagating information in a call:
- Keep all registers values;
- Keep the stack state (be sure to shift it the right way).
The calling convention is only required when setting a function's type. For that we need to track what registers / stack offsets are used in the function without beeing set before, and guess the function's cc from that. This should be easy for register-parameters, less for stack parameters.