Control-flow integrity in 5.13
Control-flow integrity in 5.13
Posted May 25, 2021 18:00 UTC (Tue) by andresfreund (subscriber, #69562)In reply to: Control-flow integrity in 5.13 by Paf
Parent article: Control-flow integrity in 5.13
I can't imagine a binary search working well, but it's not hard to believe a few hot cases checked linearly could work out. A mispredicted call is pretty expensive.
I'm pretty sure that several compilers use profile guided "optimistic" devirtualization, which basically ends up with code like
if (call_target == very_common_target) very_common_target() else if (call_target == also_common_target) also_common_target() else *call_target(). And I've seen code like that manually written in plenty places, with good success.
