summaryrefslogtreecommitdiff
path: root/core/cortex-m0/ec.lds.S
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-08-16 15:35:43 +0200
committerchrome-bot <chrome-bot@chromium.org>2018-10-16 10:30:37 -0700
commit69bc0deb614cc131cd669b5ac8935e68d10ac6e5 (patch)
tree5d85ef9f55aa7a34ba5d4de3ddefed95d87175e3 /core/cortex-m0/ec.lds.S
parent9a16a6b9cf701d43ba0e7e8f71ac081e15430be3 (diff)
downloadchrome-ec-69bc0deb614cc131cd669b5ac8935e68d10ac6e5.tar.gz
chip/stm32: Convert usb_endpoints to C so gcc's LTO knows about it
If we keep it assembly-only, the link time optimizer gets confused and eliminates seemingly unused functions, to then replace references to them with the "no handler" defaults in a later step. Similar approach as with vecttable: Implement the table in C so LTO knows the entire story. BUG=b:65441143 BRANCH=none TEST=usb_ep_{rx,tx,event} and usb_iface_request look more reasonable in disassembly on whiskers. Change-Id: I35ccfd68cda2d0022aa464ecf622f4eef71c3398 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1177710 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Jonathan Brandmeyer <jbrandmeyer@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Diffstat (limited to 'core/cortex-m0/ec.lds.S')
-rw-r--r--core/cortex-m0/ec.lds.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S
index c72ec5a5cc..d7830be852 100644
--- a/core/cortex-m0/ec.lds.S
+++ b/core/cortex-m0/ec.lds.S
@@ -172,6 +172,10 @@ SECTIONS
__usb_desc_end = .;
. = ALIGN(4);
KEEP(*(.rodata.usb_ep))
+ KEEP(*(.rodata.usb_ep.usb_ep_tx))
+ KEEP(*(.rodata.usb_ep.usb_ep_rx))
+ KEEP(*(.rodata.usb_ep.usb_ep_event))
+ KEEP(*(.rodata.usb_ep.usb_iface_request))
. = ALIGN(4);
*(.rodata*)