Merge "Makefile: Enable Stack protector flag"

This commit is contained in:
Linux Build Service Account 2019-06-10 17:35:37 -07:00 committed by Gerrit - the friendly Code Review server
commit 4f840795ea
3 changed files with 14 additions and 1 deletions

View file

@ -566,7 +566,11 @@ ifdef BUILD_TAG
KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"'
endif
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
ifdef CONFIG_ARCH_IPQ807x
KBUILD_CFLAGS += $(call cc-option,-fstack-protector)
else
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
endif
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks)
KBUILD_CFLAGS += -g

View file

@ -35,6 +35,7 @@
#define ELF_HDR_PLUS_PHDR_SIZE sizeof(Elf32_Ehdr) + \
(NO_OF_PROGRAM_HDRS * sizeof(Elf32_Phdr))
unsigned long __stack_chk_guard = 0x000a0dff;
static int debug = 0;
static char mtdids[256];
DECLARE_GLOBAL_DATA_PTR;
@ -78,6 +79,10 @@ typedef struct {
} image_info;
#endif
void __stack_chk_fail(void)
{
printf("stack-protector: U-boot stack is corrupted.\n");
}
/*
* Set the root device and bootargs for mounting root filesystem.
*/
@ -88,6 +93,8 @@ static int set_fs_bootargs(int *fs_on_nand)
int ret = 0;
char boot_args[MAX_BOOT_ARGS_SIZE] = {'\0'};
#define nand_rootfs "ubi.mtd=" QCA_ROOT_FS_PART_NAME " root=mtd:ubi_rootfs rootfstype=squashfs"
if (sfi->flash_type == SMEM_BOOT_SPI_FLASH) {

View file

@ -305,7 +305,9 @@ static inline int print_cpuinfo(void)
#endif
int update_flash_size(int flash_size);
int arch_early_init_r(void);
extern unsigned long __stack_chk_guard;
void __stack_chk_fail(void);
/**
* arch_cpu_init_dm() - init CPU after driver model is available
*