summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMulin Chao <mlchao@nuvoton.com>2015-12-28 18:04:21 +0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-30 20:40:48 -0800
commit8d99bd934541cafc2a151bf4765877b10b4df0e9 (patch)
tree49a50aaff98636062e670dd6e120d0df43491b3e
parenteebef1b8fd5f2caadc463b53445fe3c14c56b3c5 (diff)
downloadchrome-ec-stabilize-7797.B.tar.gz
wheatley: Add CONFIG_LTO definition to reduce FW size.stabilize-7797.B
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 <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/319799 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/wheatley/board.h1
-rw-r--r--chip/npcx/header.c2
2 files changed, 2 insertions, 1 deletions
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 */