Skip to content
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

[Backport v3.4-branch] Fix linker scripts to define _end correctly #59808

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Jun 28, 2023

Backport bbec614~2..bbec614 from #57727.

Fixes: #60545

…M data

The Zephyr linker scripts have inconsistent ordering of various chunks of
data which lands in RAM at runtime. This leads to the value of _end not
being consistently defined as the maximum address of static variables used
in the application.

Create a helper linker fragment, zephyr/linker/ram-end.ld, which can be
included after the last possible definition of RAM data, that consistently
sets _image_ram_end, _end and z_mapped_end.

Signed-off-by: Keith Packard <[email protected]>
(cherry picked from commit 710422e)
The generated scripts don't include a definition for any symbol indicating
the end of statically allocated memory (such as "_end"). Add a shared cmake
fragment, ram-end.cmake, which contains the necessary instructions to
define _end and z_mapped_end consistently to align with the other sample
linker scripts.

Signed-off-by: Keith Packard <[email protected]>
(cherry picked from commit bbec614)
@fabiobaltieri
Copy link
Member

fabiobaltieri commented Jul 18, 2023

@keith-packard can you add a tracking issue for this?

@keith-packard
Copy link
Collaborator

@keith-packard can you add a tracking issue for this?

Like this: #60545 ?

@fabiobaltieri
Copy link
Member

@keith-packard can you add a tracking issue for this?

Like this: #60545 ?

Cool, thanks!

@jgl-meta
Copy link
Collaborator

jgl-meta commented Aug 4, 2023

Can some more people take a look at this one?

@jgl-meta jgl-meta merged commit 5952c22 into v3.4-branch Aug 4, 2023
23 checks passed
@nashif nashif deleted the backport-57727-to-v3.4-branch branch August 15, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport Backport PR and backport failure issues
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants