Skip to content

linker generator: Handle .last_section #89739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

bjorniuppsala
Copy link
Contributor

Add cmake linker generator things for .last_section for cmake linker generator.

Follow up to #88970. Fixes bug #89719, for gcc/ld not for iar (yet)

This has been checked as described in the bug:
west -v build -p -b qemu_cortex_m3 /workdir/zephyr_iar-mn/tests/kernel/threads/thread_apis -- -DZEPHYR_TOOLCHAIN_VARIANT=zephyr -DCONFIG_CMAKE_LINKER_GENERATOR=y -DCONFIG_LINKER_LAST_SECTION_ID=y

Comparing the map-files with and without CONFIG_CMAKE_LINKER_GENERATOR.

# rom region data usage match when CONFIG_LINKER_LAST_SECTION_ID=y.
zephyr_linker_section(NAME .last_section VMA FLASH LMA FLASH NOINPUT)
# KEEP can not be passed to zephyr_linker_section, so:
zephyr_linker_section_configure(SECTION .last_section INPUT ".last_section" KEEP)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline at the end of the file :) you probably need to config your editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now.

@bjorniuppsala bjorniuppsala force-pushed the last_section_for_cmake_linker_gen branch from b2fbffb to 13e4ae6 Compare May 12, 2025 08:09
@bjorniuppsala
Copy link
Contributor Author

Hmm. On closer inspection this didnt solve the problem. I'll be back

@bjorniuppsala bjorniuppsala force-pushed the last_section_for_cmake_linker_gen branch 4 times, most recently from fb61ec6 to 8ae871a Compare May 13, 2025 07:25
Add  cmake linker generator things for .last_section.

Follow up to zephyrproject-rtos#88970. Fixes bug zephyrproject-rtos#89719, for gcc/ld & iar

Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
@bjorniuppsala bjorniuppsala force-pushed the last_section_for_cmake_linker_gen branch from 8ae871a to 06bc457 Compare May 13, 2025 08:09
Copy link

@bjorniuppsala
Copy link
Contributor Author

bjorniuppsala commented May 15, 2025

In the current state it works. Except in a corner case for iar (which will be fixed elsewhere).

So please, review and if approriate, approve

@bjorniuppsala
Copy link
Contributor Author

Any reviews or comments would be highly appreciated

@bjorniuppsala bjorniuppsala requested a review from carlescufi May 21, 2025 06:56
@RobinKastberg RobinKastberg self-requested a review May 26, 2025 11:45
@kartben kartben merged commit 01d3316 into zephyrproject-rtos:main May 26, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants