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

kernel: tls: align tdata/tbss sections in stack #32016

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

dcpleung
Copy link
Member

@dcpleung dcpleung commented Feb 5, 2021

This lets the linker tell us what kind of alignment is required
for both tdata and tbss data when copying them into stack.
If they are not aligned as expected by the toolchain, generated
code would be accessing incorrect location for thread variables.

Fixes #32015

Signed-off-by: Daniel Leung [email protected]

This lets the linker tell us what kind of alignment is required
for both tdata and tbss data when copying them into stack.
If they are not aligned as expected by the toolchain, generated
code would be accessing incorrect location for thread variables.

Fixes zephyrproject-rtos#32015

Signed-off-by: Daniel Leung <[email protected]>
It was discovered that TLS data/bss in stack need to be
aligned correctly or else incorrect variables would be
accessed. This makes tdata and tbss sections to have
odd sizes to make sure everything still works.

Signed-off-by: Daniel Leung <[email protected]>
@dcpleung dcpleung requested a review from ceolin February 5, 2021 04:19
@github-actions github-actions bot added area: API Changes to public APIs area: Kernel area: Tests Issues related to a particular existing or missing test labels Feb 5, 2021
@nashif nashif merged commit 89a9096 into zephyrproject-rtos:master Feb 8, 2021
@dcpleung dcpleung deleted the kernel_fix_tls branch February 8, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Kernel area: Tests Issues related to a particular existing or missing test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Thread local storage is broken when adding more thread variables
3 participants