Skip to content

Commit

Permalink
linker: lld: cortex_m: Place .ARM.exidx sections when using lld
Browse files Browse the repository at this point in the history
Currently, .ARM.exidx input sections are only handled when building with
ld. When building with lld (and depending on the orphan section handling
policy configured), a few issues can arise:

  1. lld may produce warnings about the orphan section
  2. lld may place the input .ARM.exidx sections in unexpected ways--it
     seems lld does place the .ARM.exidx input sections in the expected
     .ARM.exidx output section, but it places them at the end of the
     section (after '__exidx_end').

To resolve the possible warning and unexpected placement, explicitly
handle .ARM.exidx sections when lld is used.

(cherry picked from commit d77dc62)

Original-Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
GitOrigin-RevId: d77dc62
Change-Id: I8d68a022962fc577047e80eac503b42fd90d284c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5520892
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
jonathonpenix authored and Chromeos LUCI committed May 7, 2024
1 parent 74260ee commit f20da17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/zephyr/arch/arm/cortex_m/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ SECTIONS
* section overlap.
*/
__exidx_start = .;
#if defined (__GCC_LINKER_CMD__)
#if defined (__GCC_LINKER_CMD__) || defined (__LLD_LINKER_CMD__)
*(.ARM.exidx* gnu.linkonce.armexidx.*)
#endif
__exidx_end = .;
Expand Down

0 comments on commit f20da17

Please sign in to comment.