From 8d99bd934541cafc2a151bf4765877b10b4df0e9 Mon Sep 17 00:00:00 2001 From: Mulin Chao Date: Mon, 28 Dec 2015 18:04:21 +0800 Subject: [PATCH] wheatley: Add CONFIG_LTO definition to reduce FW size. Add CONFIG_LTO definition to reduce the size of FW image. Modified drivers: 1. board.h: Add CONFIG_LTO definition. 2. header.c: Add __keep keyword to prevent linker ignore header during optimization. BUG=chrome-os-partner:34346 TEST=make buildall -j; test nuvoton IC specific drivers BRANCH=none Change-Id: I6205af37572a68f35f90dbd9b28d86230533ca8b Signed-off-by: Mulin Chao Reviewed-on: https://chromium-review.googlesource.com/319799 Reviewed-by: Vincent Palatin Reviewed-by: Shawn N --- board/wheatley/board.h | 1 + chip/npcx/header.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/board/wheatley/board.h b/board/wheatley/board.h index 72d87cdd21..643a5c91f4 100644 --- a/board/wheatley/board.h +++ b/board/wheatley/board.h @@ -51,6 +51,7 @@ #define CONFIG_LID_ANGLE_SENSOR_LID 2 #define CONFIG_LID_SWITCH #define CONFIG_LOW_POWER_IDLE +#define CONFIG_LTO #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 #define CONFIG_POWER_COMMON diff --git a/chip/npcx/header.c b/chip/npcx/header.c index 49b7488b4f..0ba3ee59d6 100644 --- a/chip/npcx/header.c +++ b/chip/npcx/header.c @@ -57,7 +57,7 @@ struct __packed fw_header_t { uint32_t sig_fw_image; /* The CRC or Checksum of the firmware image */ } __aligned(1); -__attribute__ ((section(".header"))) +__keep __attribute__ ((section(".header"))) const struct fw_header_t fw_header = { /* 00 */ SIG_FW_EC, /* 04 */ 0x54E1, /* Header CRC check Enable/Disable -> AB1Eh/54E1h */