From 4caab1cce5b705b27477148dad7829ada37239b4 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Thu, 16 Apr 2020 17:49:43 +0300 Subject: [PATCH] Turn on ARM linker --inline For release and develop profiles, turn on the linker's `--inline` optimisation. This can save a couple of hundred bytes in a typical image. The optimisation replaces branches to small functions with the inlined code from those functions. And it's possible that the out-of-line functions can be eliminated. Setting confined to release and develop builds only, as it can lead to invalid debug information. --- tools/profiles/develop.json | 6 +++--- tools/profiles/release.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index 4e955ddb23..21ba5c88d5 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -24,7 +24,7 @@ "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu11"], "cxx": ["-fno-rtti", "-fno-c++-static-destructors", "-std=gnu++14"], - "ld": ["--show_full_path", "--legacyalign", "--any_contingency", + "ld": ["--show_full_path", "--legacyalign", "--inline", "--any_contingency", "--keep=os_cb_sections"] }, "ARM": { @@ -34,7 +34,7 @@ "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp11", "--no_rtti", "--no_vla"], - "ld": ["--show_full_path", "--any_contingency", "--keep=os_cb_sections"] + "ld": ["--show_full_path", "--any_contingency", "--inline", "--keep=os_cb_sections"] }, "uARM": { "common": ["-c", "--gnu", "-Ospace", "--split_sections", @@ -45,7 +45,7 @@ "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp11", "--no_rtti", "--no_vla"], - "ld": ["--library_type=microlib"] + "ld": ["--inline", "--library_type=microlib"] }, "IAR": { "common": [ diff --git a/tools/profiles/release.json b/tools/profiles/release.json index 5c3c103fae..2f44474cb7 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -24,7 +24,7 @@ "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu11"], "cxx": ["-fno-rtti", "-fno-c++-static-destructors", "-std=gnu++14"], - "ld": ["--show_full_path", "--legacyalign", "--any_contingency", + "ld": ["--show_full_path", "--legacyalign", "--inline", "--any_contingency", "--keep=os_cb_sections"] }, "ARM": { @@ -34,7 +34,7 @@ "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp11", "--no_rtti", "--no_vla"], - "ld": ["--show_full_path", "--any_contingency", "--keep=os_cb_sections"] + "ld": ["--show_full_path", "--any_contingency", "--inline", "--keep=os_cb_sections"] }, "uARM": { "common": ["-c", "--gnu", "-Ospace", "--split_sections", @@ -44,7 +44,7 @@ "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp11", "--no_rtti", "--no_vla"], - "ld": ["--library_type=microlib"] + "ld": ["--inline", "--library_type=microlib"] }, "IAR": { "common": [