Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fcd confuses short functions with tail calls to stubs with stubs #44

Open
fay59 opened this issue Mar 17, 2017 · 1 comment
Open

Fcd confuses short functions with tail calls to stubs with stubs #44

fay59 opened this issue Mar 17, 2017 · 1 comment
Labels

Comments

@fay59
Copy link
Owner

fay59 commented Mar 17, 2017

Functions with a single basic block that end in a tail call to a linker stub are confused with linker stubs. This causes a cascade of problems that culminates in that function being replaced with, for instance, a strcmp.47 that has no body and accepts an x86_regs* as a parameter, while the original function could have had a completely different name and could have done much more than just tail-calling strcmp.

This is a product of fcd doing a single pass over executables to identify both blocks and functions and produce LLVM IR, and stub identification logic being shoddy.

@fay59 fay59 added the bug label Mar 17, 2017
@fay59
Copy link
Owner Author

fay59 commented Mar 25, 2017

The solution is probably to replace the stub detection logic with proper tail call handling, and then in an AST pass or something, replace functions that literally just call another function with the exact same parameters with the function that it's calling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant