Compiler Flags - fstack-protector-strong and pie
Posted: Tue Sep 19, 2017 4:19 am
Hello all
I am trying to compile using some gcc security CFlags like fstack-protector-strong , -pie flags , added them manually at project.mk.
But getting dangerous relocation: dynamic relocation in read-only section. Can you help me out on how to enable these flags. Can it be enabled ?
CFLAGS += -fstack-protector-strong
CFLAGS += -O2 -D_FORTIFY_SOURCE=2
CFLAGS += -Wformat -Wformat-security
LDFLAGS ?=
-z relro -z now \
-z noexecstack \
-pie
Also would like to know on esp-idf can we have any option to compile bootloader and app + partition separately
thanks
abhiram
I am trying to compile using some gcc security CFlags like fstack-protector-strong , -pie flags , added them manually at project.mk.
But getting dangerous relocation: dynamic relocation in read-only section. Can you help me out on how to enable these flags. Can it be enabled ?
CFLAGS += -fstack-protector-strong
CFLAGS += -O2 -D_FORTIFY_SOURCE=2
CFLAGS += -Wformat -Wformat-security
LDFLAGS ?=
-z relro -z now \
-z noexecstack \
-pie
Also would like to know on esp-idf can we have any option to compile bootloader and app + partition separately
thanks
abhiram