summaryrefslogtreecommitdiff
path: root/core/cortex-m/panic.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2015-04-27 14:47:19 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-05-19 02:46:27 +0000
commit2650ff3d70c9933e4c3dcd1401ca66b4426def4a (patch)
tree7a4658b060d3439a525a7562c226358d55424035 /core/cortex-m/panic.c
parentcb29daa58c0fa5866a7847c454967ef0376c7688 (diff)
downloadchrome-ec-2650ff3d70c9933e4c3dcd1401ca66b4426def4a.tar.gz
Add option to enable GCC LTO
Add CONFIG_LTO to use GCC Link-Time Optimizations to try to reduce the flash footprint of the firmware. Add additional protection to some functions/data to avoid removal by the linker when their usage is not obvious. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=none TEST=make buildall (with and without LTO enable on all boards) Change-Id: I586b8c1eda4592b416c85383b65153c1d5ab0059 Reviewed-on: https://chromium-review.googlesource.com/271291 Trybot-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core/cortex-m/panic.c')
-rw-r--r--core/cortex-m/panic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c
index 6b81e8c484..0d484bf1d0 100644
--- a/core/cortex-m/panic.c
+++ b/core/cortex-m/panic.c
@@ -302,7 +302,7 @@ void panic_data_print(const struct panic_data *pdata)
#endif
}
-void report_panic(void)
+void __keep report_panic(void)
{
struct panic_data *pdata = pdata_ptr;
uint32_t sp;
@@ -352,7 +352,7 @@ void report_panic(void)
*
* Declare this as a naked call so we can extract raw LR and IPSR values.
*/
-void exception_panic(void) __attribute__((naked));
+void __keep exception_panic(void) __attribute__((naked));
void exception_panic(void)
{
/* Save registers and branch directly to panic handler */