Today, most firmware implementations are written in the C language. At the same time, the C compiler provides rich compiler options to harden the software. Some of the compiler options can also be applied to the firmware. This chapter only focuses on the C language and C compiler. If the firmware is written in another language, such as Rust or Forth, we will discuss those details in Chapter 20.
There are two major types of compiler defensive methods – to eliminate the vulnerability and to thwart the exploit. To support eliminating ...