summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-10-28 09:09:14 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-04 23:35:48 +0000
commit39caf07089611bcd1ac01ac33907c77f415b93c5 (patch)
treed4971dd2ac03f1aa738727c20f5867af1362e342
parent365143e8cea63db9b1016ff336cad37463899c88 (diff)
downloadchrome-ec-factory-brya-15231.B-main.tar.gz
chip/mchp/lfw: Discard ARM.* sectionsfactory-brya-15231.B-main
Linking with clang/lld fails since it tries to include .ARM.exidx in the VECTOR region: ld.lld: error: section '.ARM.exidx' will not fit in region 'VECTOR': overflowed by 328 bytes We don't need the exception index table or exception table (see https://crrev.com/c/3857943). This matches the behavior in our other linker scripts: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/core/cortex-m/ec.lds.S;l=745;drc=84b2904dead700e10073080c54e69ea162d8a7c5 This change does not affect the gcc/ld build (identical output before and after). BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I65df11f3ab0c439ea3d4ce2805afaac942b22a0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3989667 Reviewed-by: Diana Z <dzigterman@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
-rw-r--r--chip/mchp/lfw/ec_lfw.ld8
-rw-r--r--chip/mchp/lfw/ec_lfw_416kb.ld8
2 files changed, 16 insertions, 0 deletions
diff --git a/chip/mchp/lfw/ec_lfw.ld b/chip/mchp/lfw/ec_lfw.ld
index 1c745d5d2a..d178a42280 100644
--- a/chip/mchp/lfw/ec_lfw.ld
+++ b/chip/mchp/lfw/ec_lfw.ld
@@ -82,4 +82,12 @@ SECTIONS
} >SRAM
__image_size = LOADADDR(.text) + SIZEOF(.text) - ORIGIN(VECTOR);
+
+ /*
+ * Discard C++ exception index table and exception table. These are
+ * described in more detail in "Exception Handling ABI for ARM
+ * Architecture":
+ * https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
+ */
+ /DISCARD/ : { *(.ARM.*) }
}
diff --git a/chip/mchp/lfw/ec_lfw_416kb.ld b/chip/mchp/lfw/ec_lfw_416kb.ld
index 93d70ffbe8..c7dfacada3 100644
--- a/chip/mchp/lfw/ec_lfw_416kb.ld
+++ b/chip/mchp/lfw/ec_lfw_416kb.ld
@@ -86,4 +86,12 @@ SECTIONS
} >SRAM
__image_size = LOADADDR(.text) + SIZEOF(.text) - ORIGIN(VECTOR);
+
+ /*
+ * Discard C++ exception index table and exception table. These are
+ * described in more detail in "Exception Handling ABI for ARM
+ * Architecture":
+ * https://github.com/ARM-software/abi-aa/blob/60a8eb8c55e999d74dac5e368fc9d7e36e38dda4/ehabi32/ehabi32.rst#54the-object-producer-interface
+ */
+ /DISCARD/ : { *(.ARM.*) }
}