im-tomu / toboot

Bootloader for the EFM32HG Tomu Board
https://tomu.im/
GNU General Public License v3.0
73 stars 28 forks source link

use hardening flags when compiling #51

Open baldurmen opened 5 years ago

baldurmen commented 5 years ago

Those flags come from the Debian gcc hardening best practices: https://wiki.debian.org/Hardening

Sadly, we can't use any stack protector since it's not supported by the gcc arm cross compiler.

I also replaced Os by O2, as I found it made litteraly no difference and that's what Debian recommends:

user@computer:~/toboot$ ls -l *
O2-bins:
total 228
-rw-r--r-- 1 user user   5664 nov 15 00:19 toboot.bin
-rw-r--r-- 1 user user   6660 nov 15 00:19 toboot-booster.bin
-rw-r--r-- 1 user user   6676 nov 15 00:19 toboot-booster.dfu
-rw-r--r-- 1 user user 191496 nov 15 00:19 toboot.elf
-rw-r--r-- 1 user user  15964 nov 15 00:19 toboot.ihex

Os-bins:
total 228
-rw-r--r-- 1 user user   5664 nov 15 00:19 toboot.bin
-rw-r--r-- 1 user user   6660 nov 15 00:19 toboot-booster.bin
-rw-r--r-- 1 user user   6676 nov 15 00:19 toboot-booster.dfu
-rw-r--r-- 1 user user 191492 nov 15 00:19 toboot.elf
-rw-r--r-- 1 user user  15964 nov 15 00:19 toboot.ihex