diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2019-03-22 16:56:25 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-26 04:43:31 -0700 |
commit | 2ad68a68b3b738340f05711dfa50b0894d17b20a (patch) | |
tree | b99124b93e0fa3f441bc227e690de07558717906 | |
parent | 7c91b658c6c0c1ef9a08f2409190bbda0c2a0140 (diff) | |
download | chrome-ec-2ad68a68b3b738340f05711dfa50b0894d17b20a.tar.gz |
kukui_scp: Enable CONFIG_LTO
Fix the stepping stone code stack_end definition to match the one
in vecttable.c (else LTO complains).
Add __keep to SECTION_KEEP to prevent LTO from dropping the stepping
stone.
BRANCH=none
BUG=b:129111699
TEST=kukui_scp boots, kernel recognizes it
TEST=Saves ~1.5kb of RAM. Before/after:
*** 459968 bytes in RAM still available on kukui_scp ****
*** 461528 bytes in RAM still available on kukui_scp ****
Change-Id: I07e9d9ac003bdc5fce2617aa3aad072b51f89b6b
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1535089
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Yilun Lin <yllin@chromium.org>
-rw-r--r-- | board/kukui_scp/board.h | 2 | ||||
-rw-r--r-- | chip/mt_scp/stepping_stone.c | 2 | ||||
-rw-r--r-- | include/link_defs.h | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/board/kukui_scp/board.h b/board/kukui_scp/board.h index 4f45bde98f..7bd60c306a 100644 --- a/board/kukui_scp/board.h +++ b/board/kukui_scp/board.h @@ -50,6 +50,8 @@ #define CONFIG_IPI #define CONFIG_RPMSG_NAME_SERVICE +#define CONFIG_LTO + /* IPI ID should be in sync across kernel and EC. */ #define IPI_SCP_INIT 0 #define IPI_VDEC_H264 1 diff --git a/chip/mt_scp/stepping_stone.c b/chip/mt_scp/stepping_stone.c index 240f2ea2b1..0e880b1924 100644 --- a/chip/mt_scp/stepping_stone.c +++ b/chip/mt_scp/stepping_stone.c @@ -13,7 +13,7 @@ #include "common.h" #include "link_defs.h" -extern void *stack_end; +extern void stack_end(void); /* not technically correct, it's just a pointer */ extern void reset(void); __SECTION_KEEP(stepping_stone) const void *ss_header[2] = { diff --git a/include/link_defs.h b/include/link_defs.h index a9bd0bcf9b..0f83d0173e 100644 --- a/include/link_defs.h +++ b/include/link_defs.h @@ -119,7 +119,7 @@ extern void *__dram_bss_end; #ifdef CONFIG_CHIP_MEMORY_REGIONS #define __SECTION(name) __attribute__((section("." STRINGIFY(name) ".50_auto"))) #define __SECTION_KEEP(name) \ - __attribute__((section("." STRINGIFY(name) ".keep.50_auto"))) + __keep __attribute__((section("." STRINGIFY(name) ".keep.50_auto"))) #else #define __SECTION(name) #define __SECTION_KEEP(name) |