A FPGA-based control-flow integrity solution for securing bare-metal embedded systems