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.

Signed-off-by: Jonathon Penix <[email protected]>
  • Loading branch information
jonathonpenix authored and carlescufi committed May 7, 2024
1 parent b1de9a6 commit d77dc62
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 d77dc62

Please sign in to comment.