Closed adrianherrera closed 1 year ago
Hi @adrianherrera, thanks for the PR! Sorry for the late answer to it... Could you :
@adrianherrera sorry for getting back to this so terribly late. We haven't had a lot of resources to work on SymCC, so I'm only now finding time to go through the open pull requests...
I really like the idea of adding LLVM passes that support SymCC! The first commit, adding the scalarizer and atomics lowering, should be no problem to add; I will cherry-pick it and merge immediately if the tests pass. The second commit, lifting inline assembly, makes a lot of sense too, but I'm a bit worried that it's a lot of code for a small feature: pass registration is really noisy (not your fault at all, it's what LLVM does), lifting is only supported for x86 and ARM, and it only handles byte swapping. If you don't mind, I'll change the code a bit:
Hi, that's interesting, thanks both for the work on the features. I really like the lifter feature, however, it seem to work for simple inline assembly, are there any drawbacks to it ? If so shall we make this optional provide a warning about it?
I really like the lifter feature, however, it seem to work for simple inline assembly, are there any drawbacks to it ? If so shall we make this optional provide a warning about it?
I don't see any drawbacks :thinking: It won't work all the time, but when it works the result is better than what we had before.
I really like the lifter feature, however, it seem to work for simple inline assembly, are there any drawbacks to it ? If so shall we make this optional provide a warning about it?
I don't see any drawbacks thinking It won't work all the time, but when it works the result is better than what we had before.
OK, great thanks !
Awesome, thanks for fixing the PR! Recently we have been working with Trail of Bits and their Remvill/Anvill lifting tools to lift more complicated inline assembly code constructs. Hopefully, we'll soon be able to share this if you're interested.
Sounds very nice! :blush: I'm definitely interested.
The PR introduces a number of LLVM passes into the symbolize process.
The
ExpandAsm
pass exploits LLVM's target lowering and its ability to expand inline assembly into explicit LLVM code.Importantly, this expansion includes lifting
bswap
instructions to thebswap
intrinsic, which can be symbolized with symcc. This fixes issue #29 and does away with the hacks made in PR #75 (in an attempt to get the tests to pass).We also run the LLVM scalarizer and loweratomics passes. The former removes most vector instructions and the latter removes atomic instructions. These instructions are currently unsupported by symcc.