[llvm-commits] [compiler-rt] r153249 - /compiler-rt/trunk/lib/asan/interception/mach_override/mach_override.c

Alexander Potapenko glider at google.com
Fri Mar 23 01:25:16 PDT 2012


> FYI,
> an analog of mach_override for Windows took just ~40 LOC
> (see OverrideFunction in
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/interception/interception_win.cc?revision=152557&view=markup
> )
>
> This might be harder to achieve on Linux/Mac as the default calling
> convention is different though.
>
We can probably save 150-200 LOC if we discard the PowerPC version
from mach_override.
Some size/readability boost can be gained from refactoring the current
code and removing some legacies -- I have ideas how to do that, but
that's a low priority let us make OS X developers use our tools before
:)
Unfortunately this will never be ~40 LOC for Mac or Linux, because the
libc function prologues are very diverse. Together with instructions
like MOV, PUSH, CMP, which can be copied verbatim, there are JMP
(J-whatever) and CALL instructions that contain relative addresses.



More information about the llvm-commits mailing list