Skip to content

Linker scripts not working properly on xtensa #42477

@zycz

Description

@zycz

Problem:
There is a problem with xtensa linker script. Compiler does not see linker script added in cmake with zephyr_linker_sources on xtensa platform.

To reproduce:
If you create linker file (for example test.ld and create some marker there) and add it in cmake using:
zephyr_linker_sources(SECTIONS test.ld)
it works perfectly well on all platforms but xtensa (this marker can be visible in zephyr.map).

To reproduce it you can also use this PR: #38611
and try to run Event Manager sample (it uses linker script in such way) on any xtensa platform.

Solution?:
Adding: #include <snippets-sections.ld> in soc/xtensa/sample_controller/linker.ld solves the problem.
Do not know if it was not added on purpose or because of mistake?

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions