diff options
author | Patrick Georgi <pgeorgi@google.com> | 2018-08-16 15:35:43 +0200 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-16 10:30:37 -0700 |
commit | f3ee6eab984aa6855dea035b7771540280371b34 (patch) | |
tree | 2281612c4f94f00ac59d98bbb2e9d72f254f9cc1 /core | |
parent | 69bc0deb614cc131cd669b5ac8935e68d10ac6e5 (diff) | |
download | chrome-ec-f3ee6eab984aa6855dea035b7771540280371b34.tar.gz |
chip/g: 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,reset} and usb_iface_request look more reasonable in
disassembly on cr50.
Change-Id: I72103af742164c29aac38e9929d1a83d8c154b53
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1177711
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')
-rw-r--r-- | core/cortex-m/ec.lds.S | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 5b628f897f..87c8b3ae7a 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -237,6 +237,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_reset)) + KEEP(*(.rodata.usb_ep.usb_iface_request)) . = ALIGN(4); *(.rodata*) |