We just launched BOLT - a Binary Optimization and Layout Tool - to help you optimize the performance of your Linux binaries. https://code.facebook.com/posts/605721433136474/accelerate-large-scale-applications-with-bolt/ … GitHub:https://github.com/facebookincubator/BOLT …
-
-
that's certainly some interesting code, but I don't see any reason on the face of it why it would get broken
-
Look specifically at the linked line. It depends on an address change check on the program counter which will be broken if the instruction stream is rearranged in some "equivalent" way.
-
I don't see a problem-- the FB tool rearranges the code any way it likes, but the property being checked at this line won't be affected, it's not like the binary is getting rewritten on the fly
-
Reorder __cp_end before __cp_begin and add a jump. Logically __cp_end is anchored to the "end of the insn before it", but there's no way a tool can see this.
-
Worse, CSE some of the code between __cp_begin and the syscall insn, with a call out to it. Now (1) the range check gets a false negative, and (2) if cancellation is acted upon, SP is wrong when control transfers to __cp_cancel.
-
well, I'd assume they're using something like -ffunction-sections and that's the granularity for rearrangement, I agree there's a world of hurt if they make the kind of changes you suggest here
-
Did you read the article? It seems they convert it to some kind of LLVM IR ("LLVM’s MCInst format"?) and let LLVM have at it...
-
They operate on machine code, don't have any metadata about function boundaries etc. So I doubt they could even make the pc range check work at all.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.