-
Notifications
You must be signed in to change notification settings - Fork 7k
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
linker: move scripts generated code at the beginning of .text #17185
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When code relocation enabled, there will be serval regions holding text. And then there will be function call between these .text regions, when distance between caller and callee is too far, linker will automatically generate and insert veneer functions. And these veneer functions will be located right after the last instruction in the .text region by the linker. So these code will be put in the memory reserved for priv_stacks text and kobject text if they don't consume all the reserved memory. Or the veneer functions will be put before the reserved memory if there isn't code in the reserved memory. And then in the user mode building process, there will be different memory layout and it will cause usr mode not working. And moving the memory reserved for priv_stacks text and kobject text at the beginning of .text will avoid above problem. The detailed analysis for this issue can be found on Github issue zephyrproject-rtos#17038. Fixes: zephyrproject-rtos#17038. Signed-off-by: Wentong Wu <[email protected]>
make mpu align inside sections instead of outside to avoid overlap for code relocation feature. Signed-off-by: Wentong Wu <[email protected]>
fix spell typo in target_relocation.cmake. Signed-off-by: Wentong Wu <[email protected]>
@andrewboie @ioannisg could you please take a look this patch? thanks |
andrewboie
approved these changes
Jul 17, 2019
dcpleung
approved these changes
Jul 17, 2019
ioannisg
approved these changes
Jul 17, 2019
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub.
git fetch
# Create new working tree.
git worktree add .worktrees/backport v1.14-branch
# Navigate to the new directory.
cd .worktrees/backport
# Cherry-pick all the commits of this pull request and resolve the likely conflicts.
git cherry-pick 4fd2136072c2b9efb3c57da2b39918dc875846d8 5b7711dc463a2b0f43a6d46192684dd2fe74463e 8386e3e8a7fe4a15459edd226ca5aad4c6050389
# Create a new branch with these backported commits.
git checkout -b backport-17185-to-v1.14-branch
# Push it to GitHub.
git push --set-upstream origin backport-17185-to-v1.14-branch
# Go back to the original working tree.
cd ../..
# Delete the working tree.
git worktree remove .worktrees/backport Then, create a pull request where the |
@wentongwu This needs to be backported manually. |
|
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: ARM
ARM (32-bit) Architecture
area: Build System
area: Kernel
area: Linker Scripts
area: Userspace
Userspace
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #17038.